SystemError:使用请求和调试器时没有设置异常的错误返回 [英] SystemError: error return without exception set, when using requests and debugger

查看:80
本文介绍了SystemError:使用请求和调试器时没有设置异常的错误返回的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

环境:蟒蛇 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:使用请求和调试器时没有设置异常的错误返回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆