环境: Python 3.6.3 请求 2.18.4 PyCharm 2018.1
在正常运行中使用上述配置时一切正常。然而,当使用 PyCharm 调试器时,我的输出不断地给出两种异常:
Exception ignored in: <generator object urlsplit.<locals>.<genexpr> at 0x7f69803940a0>
Traceback (most recent call last):
File "/usr/lib/python3.6/urllib/parse.py", line 433, in <genexpr>
if not rest or any(c not in '0123456789' for c in rest):
或
SystemError: error return without exception set
Exception ignored in: <generator object iter_slices at 0x7f69803940f8>
Traceback (most recent call last):
File "/home/damian/workspace/DofusV2/venv/lib/python3.6/site-packages/requests/utils.py", line 449, in iter_slices
def iter_slices(string, slice_length):
`
这不是单个项目中的问题,我在许多项目中无数次遇到过这个问题。然而,每个项目都是多线程的(我不知道这是否有什么区别) 问题是,当我不使用调试器时,我没有这个问题,而且它并没有真正做任何事情,应用程序很稳定并且工作正常。我的问题是为什么会发生这种情况,我至少可以抑制它,这样它就不会污染我的日志吗?
最佳答案
我在使用 Gensim Word2vec 模型时遇到了类似的问题,也在 Python 3.6/PyCharm 2018.2 中使用调试器。 作为一个快速修复,我通过设置环境变量找到了解决方案:
PYDEVD_USE_FRAME_EVAL=NO
通过在 PyCharm 运行配置中设置环境变量,可以在 PyCharm 中轻松完成此操作。设置此变量后,我可以再次使用调试器。更多信息可查看here和 here .
关于python-3.x - 使用请求和调试器时出现系统错误 : error return without exception set,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50369959/