robotcodedev / robotcode

RobotFramework support for Visual Studio Code
https://robotcode.io
Apache License 2.0
168 stars 13 forks source link

[BUG] Error in console after debuging #228

Closed Krata4 closed 1 month ago

Krata4 commented 4 months ago

Describe the bug When I install Python 12, I can see error after debuging in console:

Exception in worker Traceback (most recent call last): File "C:\Program Files\Python312\Lib\concurrent\futures\thread.py", line 91, in _worker if work_item is not None: ^^^^^^^^^ File "c:\Users....vscode\extensions\ms-python.python-2024.0.1\pythonFiles\lib\python\debugpy_vendored\pydevd_pydevd_bundle\pydevd_trace_dispatch_regular.py", line 203, in trace_dispatch py_db.enable_tracing(thread_trace_func) File "c:\Users....vscode\extensions\ms-python.python-2024.0.1\pythonFiles\lib\python\debugpy_vendored\pydevd\pydevd.py", line 1107, in enable_tracing pydevd_tracing.SetTrace(thread_trace_func) File "c:\Users....vscode\extensions\ms-python.python-2024.0.1\pythonFiles\lib\python\debugpy_vendored\pydevd\pydevd_tracing.py", line 87, in SetTrace if set_trace_to_threads(tracing_func, thread_idents=[thread.get_ident()], create_dummy_thread=False) == 0: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users.....vscode\extensions\ms-python.python-2024.0.1\pythonFiles\lib\python\debugpy_vendored\pydevd\pydevd_tracing.py", line 354, in set_trace_to_threads start_new_thread(increase_tracing_count, ()) RuntimeError: can't create new thread at interpreter shutdown

With Python 11 it was without error.

Thanks Jirka

d-biehl commented 4 months ago

I noticed this as well sometimes, but it is not really reproducable for me. But after some investigation there seems to be a regression in python 3.12 see here: https://github.com/python/cpython/issues/113964

And if you look at the code and I also see this if I get this error, this seems to happen in debugpy and not in RobotCode.

Does this happens every time?

Krata4 commented 4 months ago

Yes, every time in case Test failed and I am using debuging.

d-biehl commented 2 months ago

Is this bug still there or does it work with newer versions of the Vscode Python extension?

Krata4 commented 2 months ago

unfortunately, error is till there: start_new_thread(increase_tracing_count, ()) RuntimeError: can't create new thread at interpreter shutdown

d-biehl commented 2 months ago

Hey, in one of the last versions of robotcode I changed the way the debugger starts the robot process. Also the version of the pydevd, that comes with the Python Debugger extension has changed.

Can you check if the error is still there?

Krata4 commented 1 month ago

Hi,

thanks for fix. Debugging is without error currently.