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
Description of expected behavior and the observed behavior
It appears as tho the pn.serve(... ,threaded=True) option does not work in python 3.12.2. See the error message below. As far as i can tell the app doesn't matter, this was just some test app i had handy to demonstrate the bug.
I'm not sure i actually need this feature, but i'm sharing it since it took me a little bit to debug when upgrading an old app to python 3.12.
Complete, minimal, self-contained example code that reproduces the issue
Launching server at http://localhost:56947
Task exception was never retrieved
future: <Task finished name='Task-1' coro=<SelectorThread.__init__.<locals>.thread_manager_anext() done, defined at c:\Users\...\CCG\ccg\.venv312\Lib\site-packages\tornado\platform\asyncio.py:462> exception=RuntimeError("can't create new thread at interpreter shutdown")>
Traceback (most recent call last):
File "c:\Users\...\CCG\ccg\.venv312\Lib\site-packages\tornado\platform\asyncio.py", line 465, in thread_manager_anext
await self._thread_manager_handle.__anext__()
File "c:\Users\...\CCG\ccg\.venv312\Lib\site-packages\tornado\platform\asyncio.py", line 511, in _thread_manager
self._thread.start()
File "C:\Users\...\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 992, in start
_start_new_thread(self._bootstrap, ())
File "C:\Users\...\CCG\debugpy\debugpy\src\debugpy\_vendored\pydevd\_pydev_bundle\pydev_monkey.py", line 1114, in pydev_start_new_thread
return _original_start_new_thread(_UseNewThreadStartup(function, args, kwargs), ())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: can't create new thread at interpreter shutdown
The text was updated successfully, but these errors were encountered:
This appears to be a CPython bug/regression, see python/cpython#113964. I think the solution for now is to add a time.sleep after starting the thread to ensure the thread is fully running before Python attempts to shut down.
ALL software version info
Description of expected behavior and the observed behavior
It appears as tho the
pn.serve(... ,threaded=True)
option does not work in python 3.12.2. See the error message below. As far as i can tell the app doesn't matter, this was just some test app i had handy to demonstrate the bug.I'm not sure i actually need this feature, but i'm sharing it since it took me a little bit to debug when upgrading an old app to python 3.12.
Complete, minimal, self-contained example code that reproduces the issue
Stack traceback and/or browser JavaScript console output
The text was updated successfully, but these errors were encountered: