[英]SystemError: error return without exception set, when using requests and debugger
Environment: Python 3.6.3 Requests 2.18.4 PyCharm 2018.1 环境:Python 3.6.3请求2.18.4 PyCharm 2018.1
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:
但是,当使用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):
or 要么
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?
我的问题是为什么会发生这种情况,我能否至少压制它以免污染我的日志?
I had a similar problem when using Gensim Word2vec models, also using debugger in Python 3.6 / PyCharm 2018.2. 我在使用Gensim Word2vec模型时也有类似的问题,也使用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
This can be done easily in PyCharm by settings environment variables in PyCharm run configuration. 这可以通过PyCharm运行配置中的设置环境变量在PyCharm中轻松完成。 After setting this variable, I could use debugger again.
设置此变量后,我可以再次使用调试器。 More info can be found here and here .
更多信息可以在这里和这里找到。
Just in case it helps other googlers, in Pycharm 2019 I found I'd caused this error by using a line in my urlpatterns
: 为了防止其他googlers,在Pycharm 2019中,我发现我在我的
urlpatterns
使用了一行来导致此错误:
# including this line caused the error (I wanted to catch the 'my_special_model' type and use the general one below for other models.
path('display/my_special_model/<int:item_id>/', views.display_model, name='display_model'),
# This works fine ...
path('display/<item_type>/<int:item_id>/', views.display, name='display'),
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.