gpt4 book ai didi

python - 安装 win_unc 库时出现 unicode 错误

转载 作者:行者123 更新时间:2023-12-05 07:42:01 26 4
gpt4 key购买 nike

我正在尝试安装 win_unc 库,但出现以下错误:

File "unc_credentials.py", line 36 """
Syntax error: (unicode error) 'unicodescape' codec can't decode bytes in position 340-341: truncated \uXXXX escape

这是导致问题的 unc_credentials.py 中的代码片段:

def __init__(self, username=None, password=None):
"""
Returns a new `UncCredentials` object. Both `username` and `password` are optional.
If neither are provided, the new object will mean that credentials are unnecessary.
`username` must be a string representing a Windows username (logon). Windows usernames
may include a domain prefix (i.e. "domain\username"). If `username` cannot be
construed as a valid Windows username, then this will raise an
`InvalidUsernameError`.
Note: UNC connections that require authentication will use the username of the
currently logged in Windows user unless specifically provided another
username.
Note: Providing `None` and `""` (the empty string) have very different meanings.
Usernames cannot be empty.
`password` must be a string representing a password.
Note: Providing `None` and `''` (the empty string) have very different meanings.
The empty string is a meaningful, legitimate password.

If only the first positional argument is provided and it is already an instance of the
`UncCredentials` class (either directly or by inheritance), this constructor will clone
it and create a new `UncCredentials` object with the same properties.
"""

最后一行带有 """"的是第 36 行。

它看起来像是对我的评论,但是当我摆脱它时,我得到另一个错误 no commands supplied

最后一行的双引号似乎有问题,不过我可能错了。

我试过使用不同的引号并在字符串前面使用“r”,但我要么得到相同的错误,要么没有提供命令

如果有任何关于如何解决或修复此问题的建议,我将不胜感激。

最佳答案

我不再维护这个库。我不知道这里发生了什么,但唯一想到的是文件在下载或保存过程中以某种方式损坏了。如果您打开 HEX 编辑器并按照提示检查位置 340-341,您可能会发现一个奇怪的非 ASCII 字符。

请注意,win_unc 不支持使用除英语以外的任何语言的系统。

关于python - 安装 win_unc 库时出现 unicode 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44908259/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com