After upgrading from PyCharm 2016.1.4 to 2016.2, when you start the debugger and set any breakpoint, PyCharm stops in different places where I don’t have a breakpoint and writes it to stderr:
Traceback (most recent call last):
File "/usr/local/pycharm/debug-eggs/pycharm-debug.egg/_pydevd_bundle/pydevd_frame.py", line 539, in trace_dispatch
self.do_wait_suspend(thread, frame, event, arg)
File "/usr/local/pycharm/debug-eggs/pycharm-debug.egg/_pydevd_bundle/pydevd_frame.py", line 71, in do_wait_suspend
self._args[0].do_wait_suspend(*args, **kwargs)
File "/usr/local/pycharm/debug-eggs/pycharm-debug.egg/pydevd.py", line 714, in do_wait_suspend
time.sleep(0.01)
File "/home/jaza/mypyapp/mypyfile.py", line 999, in mypyfunc
gevent.sleep(seconds)
File "/usr/local/lib/python2.7/dist-packages/gevent/hub.py", line 194, in sleep
hub.wait(loop.timer(seconds, ref=ref))
File "/usr/local/lib/python2.7/dist-packages/gevent/hub.py", line 630, in wait
result = waiter.get()
File "/usr/local/lib/python2.7/dist-packages/gevent/hub.py", line 878, in get
return self.hub.switch()
File "/usr/local/lib/python2.7/dist-packages/gevent/hub.py", line 608, in switch
switch_out()
File "/usr/local/lib/python2.7/dist-packages/gevent/hub.py", line 612, in switch_out
raise BlockingSwitchOutError('Impossible to call blocking function in the event loop callback')
BlockingSwitchOutError: Impossible to call blocking function in the event loop callback
OS: Linux Mint 17.3 (i.e. almost identical to Ubuntu 14.04). Using the latest gevent (1.1.2).
If I open my old PyCharm (i.e. 2016.1.4) and do the same thing - that is, start the debugger, set a breakpoint, start my application - I will not get these errors, and PyCharm does not stop anywhere in the code, except mine breakpoints.
"" , debug-eggs debug-eggs, PyCharm . , .. , BlockingSwitchOutError .
, PyCharm 2016.2. JetBrains, . https://youtrack.jetbrains.com/issue/PY-20183. SO, - ( gevent.sleep(seconds)?), , , .