簡體   English   中英

SystemError:使用請求和調試器時,無異常設置的錯誤返回

[英]SystemError: error return without exception set, when using requests and debugger

環境: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中輕松完成。 設置此變量后,我可以再次使用調試器。 更多信息可以在這里這里找到。

為了防止其他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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM