You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
autoreload: Conflicts with jetbrains debuggerΒ #2243
Pycharm starts the script with /usr/bin/python3.6 /opt/pycharm-eap/helpers/pydev/pydevd.py --multiproc --qt-support=auto --client 127.0.0.1 --port 33261 --file file_name.py
If I edit the file and then save it I receive
Failed to import the site module
Traceback (most recent call last):
File "/usr/lib/python3.6/site.py", line 73, in <module>
import os
File "/usr/lib/python3.6/os.py", line 652, in <module>
from _collections_abc import MutableMapping
File "/usr/lib/python3.6/_collections_abc.py", line 288, in <module>
Iterator.register(str_iterator)
File "/usr/lib/python3.6/abc.py", line 158, in register
if issubclass(subclass, cls):
File "/usr/lib/python3.6/abc.py", line 207, in __subclasscheck__
ok = cls.__subclasshook__(subclass)
KeyboardInterrupt
This issue reproduces with python 3.6. On python 2.7 autoreload works ok. I also tried to turn off Safe write in pycharm, but that doesn't affect it at all.
changed the title [-]'autoreload=true' throws 'KeyboardInterrupt' while in Pycharm debug[/-][+]'autoreload=true' throws 'KeyboardInterrupt' while debugging with python3.6[/+]on Jan 6, 2018
It looks like pycharm is trying to do its own automatic reloading when you save the file by sending an interrupt signal to the original process. You don't need two kinds of reloading, so you probably want to turn off one or the other.
Ah, this is just while the debugger is attached? I wouldn't expect that to work at all - reloading the process will at least break the connection to the debugger. If the debugger has a reloading feature then you may be able to use that, but I think you'll need to turn off tornado's autoreload feature to debug. I don't think there's anything we can do about this on the tornado side; it's a question for jetbrains.
I am currently having the same problem running py3.7. I was running intellij 2019.1 and it wouldn't work when I upgraded my application to py3 so I updated intellij ultimate to 2019.3 and it still breaks with KeyboardInterrupt only while using the debugger.
Traceback (most recent call last): File "/Users/robert/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/pydevd.py", line 7, in <module> from contextlib import contextmanager File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 724, in exec_module File "<frozen importlib._bootstrap_external>", line 818, in get_code File "<frozen importlib._bootstrap_external>", line 916, in get_data KeyboardInterrupt
Faced with the same issue in PyCharm 2021 and python 3.6. Regardless debug or not after any changes the server stops with Process finished with exit code 0
Autoreload works when I start the server from cmd
It is not expected that autoreload would work while a debugger is attached. If you use a debugger (I don't) you should turn off autoreload while debugging. If there's some way to detect the presence of a debugger and automatically disable autoreload while one is present, I would welcome the suggestion. Otherwise, I don't think there's anything for Tornado to do here and any questions should be directed to the debugger vendor (jetbrains, it seems, from every comment posted here).
changed the title [-]'autoreload=true' throws 'KeyboardInterrupt' while debugging with python3.6[/-][+]autoreload: Conflicts with jetbrains debugger[/+]on Jul 3, 2023
Activity
[-]'autoreload=true' throws 'KeyboardInterrupt' while in Pycharm debug[/-][+]'autoreload=true' throws 'KeyboardInterrupt' while debugging with python3.6[/+]bdarnell commentedon Jan 6, 2018
It looks like pycharm is trying to do its own automatic reloading when you save the file by sending an interrupt signal to the original process. You don't need two kinds of reloading, so you probably want to turn off one or the other.
akoidan commentedon Jun 3, 2018
Probably related. https://youtrack.jetbrains.com/issue/PY-28604
Notes:
autoreload=falsedoesn't reload the code while in debugruninstead ofdebugit doesn't run the script viapydevd.pyso autoreload works fines.pydevd.pySo atm it's impossible to have autoreloaded code while in debug in pycharm.
bdarnell commentedon Jun 3, 2018
Ah, this is just while the debugger is attached? I wouldn't expect that to work at all - reloading the process will at least break the connection to the debugger. If the debugger has a reloading feature then you may be able to use that, but I think you'll need to turn off tornado's autoreload feature to debug. I don't think there's anything we can do about this on the tornado side; it's a question for jetbrains.
akoidan commentedon Jun 4, 2018
Well, it works somehow with python2, I guess there should be a chance get it working with py3
worried-networking commentedon Jun 15, 2018
@Deathangel908 actually it was working for python < 3.4 :( You can check https://youtrack.jetbrains.com/issue/PY-14980, there was a workaround
desertkun commentedon Feb 19, 2019
@bdarnell The behavior has changed in 2018.3
It now does
Regardless if you debug it or not
Adding
-m tornado.autoreload -m ***.servertrick doesn't help either.maxisme commentedon Feb 21, 2019
I am having the above issue too!
gshmu commentedon Jan 15, 2020
I'm using pycharm's
Attaching to a processto debug, and run tornado server manual.the attache still broken, but the serve still runing and reload.
rdboyett commentedon Mar 5, 2020
I am currently having the same problem running py3.7. I was running intellij 2019.1 and it wouldn't work when I upgraded my application to py3 so I updated intellij ultimate to 2019.3 and it still breaks with KeyboardInterrupt only while using the debugger.
Traceback (most recent call last): File "/Users/robert/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/pydevd.py", line 7, in <module> from contextlib import contextmanager File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 724, in exec_module File "<frozen importlib._bootstrap_external>", line 818, in get_code File "<frozen importlib._bootstrap_external>", line 916, in get_data KeyboardInterruptprshir commentedon Jun 28, 2023
Faced with the same issue in PyCharm 2021 and python 3.6. Regardless debug or not after any changes the server stops with
Process finished with exit code 0Autoreload works when I start the server from cmd
bdarnell commentedon Jul 3, 2023
It is not expected that autoreload would work while a debugger is attached. If you use a debugger (I don't) you should turn off autoreload while debugging. If there's some way to detect the presence of a debugger and automatically disable autoreload while one is present, I would welcome the suggestion. Otherwise, I don't think there's anything for Tornado to do here and any questions should be directed to the debugger vendor (jetbrains, it seems, from every comment posted here).
[-]'autoreload=true' throws 'KeyboardInterrupt' while debugging with python3.6[/-][+]autoreload: Conflicts with jetbrains debugger[/+]