简体   繁体   English

SystemError:使用请求和调试器时,无异常设置的错误返回

[英]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 : 为了防止其他g​​ooglers,在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.

相关问题 Python 3.7.3 SystemError:错误返回,未设置异常 - Python 3.7.3 SystemError: error return without exception set 错误:如何修复“系统错误:<built-in function imshow> 在Opencv python中返回NULL而不设置错误” - Error : How to fix "SystemError: <built-in function imshow> returned NULL without setting an error" in Opencv python 如何修复“系统错误:<built-in function 'name'> 在 Python C 扩展中返回 NULL 而不设置错误” - How to fix "SystemError: <built-in function 'name'> returned NULL without setting an error" in Python C Extension Python中使用“requests”模块报错405 - Error 405 when using "requests" module in Python 使用请求时Python在API周围抛出错误 - Python throwing error around API when using requests 使用 BeautifulSoup 请求时如何解决超时错误? - How to solve timed out error when using requests with BeautifulSoup? 请求 package python 异常证书错误 - requests package python exception certificate error 使用python的请求模块识别并打破异常:“ OpenSSL.SSL.Error” - Identifying and breaking on exception: 'OpenSSL.SSL.Error' using python's requests module xml获取使用请求库的结果异常 - xml get using requests library results in exception 使用添加的规则集时 Cerberus 抛出异常 - Cerberus throwing exception when using added rule set
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM