gpt4 book ai didi

python - 使用 nosetest 或 print 时 oserror python 3.5.4 on win 10 1709

转载 作者:太空狗 更新时间:2023-10-30 01:36:33 25 4
gpt4 key购买 nike

自从我将 win 10 版本 1703 升级到版本 1709(秋季更新)后,在使用 printnose 命令。我的 nose 日志:

======================================================================
ERROR: test_future_link_to_update_3
----------------------------------------------------------------------
Traceback (most recent call last):
File "c:\users\sdn\work\git\pop-extrapole\env\lib\site-packages\nose\case.py", line 134, in run
self.runTest(result)
File "c:\users\sdn\work\git\pop-extrapole\env\lib\site-packages\nose\case.py", line 152, in runTest
test(result)
File "c:\program files\python35\Lib\unittest\case.py", line 653, in __call__
return self.run(*args, **kwds)
File "c:\program files\python35\Lib\unittest\case.py", line 621, in run
result.addSuccess(self)
File "c:\users\sdn\work\git\pop-extrapole\env\lib\site-packages\nose\proxy.py", line 165, in addSuccess
self.result.addSuccess(self.test)
File "c:\program files\python35\Lib\unittest\runner.py", line 64, in addSuccess
self.stream.flush()
OSError: raw write() returned invalid length 2 (should have been between 0 and 1)

我可以通过评论 self.stream.flush() 来解决这个问题,但这不是解决方案:

def addSuccess(self, test):
super(TextTestResult, self).addSuccess(test)
if self.showAll:
self.stream.writeln("ok")
elif self.dots:
self.stream.write('.')
# self.stream.flush()

使用print时的其他日志:

Traceback (most recent call last):
File "c:\program files\python35\Lib\multiprocessing\pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "c:\program files\python35\Lib\multiprocessing\pool.py", line 47, in starmapstar
return list(itertools.starmap(args[0], args[1]))
File "C:\Users\SDN\Work\git\pop-extrapole\extrapolation\extrapole.py", line 1463, in popcorn_process
print(lk)
OSError: raw write() returned invalid length 46 (should have been between 0 and 23)

有人对此有想法吗?

谢谢,乌维维尔

最佳答案

你使用“Git for Windows”的 bash 吗?

如果使用,请尝试在\Program Files\Git\git-bash.exe\Program Files\Git\usr\bin\的属性设置中加入管理员权限bash.exe.

我可以用它来解决。但我认为这不是最佳解决方案。

另一种解决方案是使用 PowerShell。

关于python - 使用 nosetest 或 print 时 oserror python 3.5.4 on win 10 1709,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47075627/

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