Error when debugging with breakpoints

I can run my Django application in normal run mode as well as in debug mode so loang as there are no breakpoints. When I create a breakpoint, however, the process produces the following error (process does not exit):

Connected to pydev debugger (build 192.6817.19)
pydev debugger: process 10708 is connecting

Unhandled exception in thread started by <_pydev_bundle.pydev_monkey._NewThreadStartupWithTrace object at 0x0000011C7F8F8BE0>
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2018.3.1\helpers\pydev\_pydevd_bundle\pydevd_constants.py", line 332, in get_current_thread_id
AttributeError: '_DummyThread' object has no attribute '__pydevd_id__'

During handling of the above exception, another exception occurred:

SystemError: ..\Objects\codeobject.c:851: bad argument to internal function

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2018.3.1\helpers\pydev\_pydev_bundle\pydev_monkey.py", line 736, in __call__
File "C:\Program Files\JetBrains\PyCharm 2018.3.1\helpers\pydev\_pydevd_bundle\pydevd_constants.py", line 339, in get_current_thread_id
File "C:\Program Files\JetBrains\PyCharm 2018.3.1\helpers\pydev\_pydevd_bundle\pydevd_constants.py", line 306, in _get_or_compute_thread_id_with_lock
SystemError: <built-in method __enter__ of _thread.lock object at 0x0000011C7C6C54B8> returned a result with an error set

4 comments
Comment actions Permalink

Please update to the latest PyCharm version and check if the issue remains.

0
Comment actions Permalink

Hey Sergey - I have this as well, and have had for a while.  Problem persists in 2019.2.3.  From advice from another thread on this forum, I currently have the following environment variables set:

PYDEVD_USE_CYTHON=NO

PYDEVD_USE_FRAME_EVAL=NO

For me, this only happens in debugging and stops the debugger when it occurs.

Here's the full stack trace.

Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/django/core/management/base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.6/dist-packages/django/core/management/commands/runserver.py", line 60, in execute
super().execute(*args, **options)
File "/usr/local/lib/python3.6/dist-packages/django/core/management/base.py", line 364, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.6/dist-packages/django/core/management/commands/runserver.py", line 95, in handle
self.run(**options)
File "/usr/local/lib/python3.6/dist-packages/django/core/management/commands/runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "/usr/local/lib/python3.6/dist-packages/django/utils/autoreload.py", line 598, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/django/utils/autoreload.py", line 583, in start_django
reloader.run(django_main_thread)
File "/usr/local/lib/python3.6/dist-packages/django/utils/autoreload.py", line 301, in run
self.run_loop()
File "/usr/local/lib/python3.6/dist-packages/django/utils/autoreload.py", line 307, in run_loop
next(ticker)
File "/usr/local/lib/python3.6/dist-packages/django/utils/autoreload.py", line 347, in tick
for filepath, mtime in self.snapshot_files():
File "/usr/local/lib/python3.6/dist-packages/django/utils/autoreload.py", line 363, in snapshot_files
for file in self.watched_files():
File "/usr/local/lib/python3.6/dist-packages/django/utils/autoreload.py", line 262, in watched_files
yield from iter_all_python_module_files()
File "/usr/local/lib/python3.6/dist-packages/django/utils/autoreload.py", line 102, in iter_all_python_module_files
modules = tuple(m[1] for m in modules_view if not isinstance(m[1], weakref.ProxyTypes))
SystemError: ../Objects/tupleobject.c:851: bad argument to internal function

0
Comment actions Permalink

@Steve

May I kindly ask you to file an issue to our bug tracker https://youtrack.jetbrains.com/issue/PY and provide some code and steps for reproducing?

0

Please sign in to leave a comment.