DDNS
DDNS copied to clipboard
[debug]运行报错
描述问题 (Describe the bug)
运行出现以下报错
. Traceback (most recent call last):
File "<string>", line 1, in <module>
ValueError: underlying buffer has been detached
Traceback (most recent call last):
File "<string>", line 1, in <module>
ValueError: underlying buffer has been detached
版本信息 (version info)
- DDNS Version: v2.11.5
- OS Version:
版本 Windows 10 专业版
版本号 21H2
安装日期 2021/10/19
操作系统内部版本 19044.1826
体验 Windows Feature Experience Pack 120.2212.4180.0
- Type(运行方式): Binary/Python2/Python3:Binary
- related issues (相关问题):
复现步骤 (To Reproduce)
配置后,在Powershell运行.\ddns.exe
配置文件 (config file)
{
"$schema": "https://ddns.newfuture.cc/schema/v2.8.json",
"debug": false,
"dns": "huaweidns",
"id": "*************",
"index4": "default",
"index6": "default",
"ipv4": [],
"ipv6": [
"mydomain.mydomain.com"
],
"proxy": null,
"token": "*****************",
"ttl": 60
}
调试输出 (debug output)
日志似乎很多敏感信息,如有需要再说
补充说明 (Additional context)
同WinServer 2021 based on 21H2用华为ddns,但是我的ddns可以正常生效。 直接运行py文件没有报错,运行exe出现2个
Traceback (most recent call last):
File "<string>", line 1, in <module>
ValueError: underlying buffer has been detached
原因应该是#366对run.py 155行增加的
if sys.version_info.major == 3 and os_name == 'nt':
from io import TextIOWrapper
sys.stdout = TextIOWrapper(sys.stdout.detach(), encoding='utf-8')
sys.stderr = TextIOWrapper(sys.stderr.detach(), encoding='utf-8')
修复windows编码的代码有些问题。 把这几行删掉,再运行
pyinstaller --noconfirm --clean ./.build/ddns.spec
自己打包出来的exe就不会显示这个报错了(控制台又变整洁了呢)。
@yinque 应该是这个地方的兼容性有问题