SystemError: error return without exception set, when using requests and debugger(SystemError:在使用请求和调试器时,没有设置异常的错误返回)
问题描述
环境:Python 3.6.3请求 2.18.4PyCharm 2018.1
Environment: Python 3.6.3 Requests 2.18.4 PyCharm 2018.1
在正常运行中使用上述配置时,一切都很好.但是,当使用 PyCharm 调试器时,我的输出不断给我两种异常:
When using the above configuration in normal run everything is fine. However,when using PyCharm debugger my output is constantly giving me two kinds of exceptions:
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):
`
这不是单个项目中的问题,我在无数项目中都遇到过这个问题.但是,每个项目都是多线程的(我不知道这是否有什么不同)问题是我在不使用调试器时没有这个问题,而且它并没有真正做任何事情,应用程序稳定并且工作正常.我的问题是为什么会发生这种情况,我至少可以抑制它,以免污染我的日志吗?
This is not an issue in a single project, I had this issue in numerous projects countless times. However, every project was multi-threaded ( I do not know if this makes any difference) The thing is I do not have this problem when not using the debugger plus it doesn't really do anything the application is stable and works fine. My question is why is this happening and can I at least suppress it so it won't pollute my log?
推荐答案
我在使用 Gensim Word2vec 模型时遇到了类似的问题,也在 Python 3.6/PyCharm 2018.2 中使用调试器.作为一个快速修复,我通过设置环境变量找到了解决方案:
I had a similar problem when using Gensim Word2vec models, also using debugger in Python 3.6 / PyCharm 2018.2. Just as a quick fix, I found a solution by setting an environment variable:
PYDEVD_USE_FRAME_EVAL=NO
这可以通过在 PyCharm 运行配置中设置环境变量在 PyCharm 中轻松完成.设置此变量后,我可以再次使用调试器.更多信息可以在 这里 和 这里.
This can be done easily in PyCharm by settings environment variables in PyCharm run configuration. After setting this variable, I could use debugger again. More info can be found here and here.
这篇关于SystemError:在使用请求和调试器时,没有设置异常的错误返回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!