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
A few particular commands in a ptpython repl cause an odd behavior in ptpython that seems to be an underlying threading problem. The commands are reproducible yet have nothing apparent that would cause anything unusual. In fact, it's just constructing an object and looking at one its properties. Here's what happends
x = A(4, 5) # A.__init__ just sets props; nothing else, but it always happens with A not B. x.prop # Just reading the prop that was just set; same happens if not printed, just assigned y = x.prop
# Long hang here, keyboard interrupt ends the hang, and the session continues
... # No problems here quit()
The repl quits but the shell does not resume, and soon after the computer fan goes nuts with Python is using more CPU.
Another keyboard interrupt, and we see the following, after which the shell resumes and the computer quiets.
^CException ignored in: <module 'threading' from '/usr/local/Cellar/[email protected]/3.10.12_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py'>
Traceback (most recent call last):
File "/usr/local/Cellar/[email protected]/3.10.12_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 1537, in _shutdown
atexit_call()
File "/usr/local/Cellar/[email protected]/3.10.12_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/thread.py", line 31, in _python_exit
t.join()
File "/usr/local/Cellar/[email protected]/3.10.12_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 1096, in join
self._wait_for_tstate_lock()
File "/usr/local/Cellar/[email protected]/3.10.12_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 1116, in _wait_for_tstate_lock
if lock.acquire(block, timeout):
KeyboardInterrupt:
^C
I'm baffled by this because my code is doing nothing basically. Yet it's the same A() that causes the hang every time...
Note that this does not occur in a standard Python repl, even with the same code. Something with the event loop? Thread handling? I'm wondering if this is related to #541.
Running on Mac OS X 12.6.1; Python 3.10 installed from homebrew.
I'm happy to answer any questions and would really appreciate any pointers on where to look or how to figure out what's happening. I've got people using the app/repl and would like to avoid random hangs.
Thanks (for your help and for ptpython)!
The text was updated successfully, but these errors were encountered:
A few particular commands in a ptpython repl cause an odd behavior in ptpython that seems to be an underlying threading problem. The commands are reproducible yet have nothing apparent that would cause anything unusual. In fact, it's just constructing an object and looking at one its properties. Here's what happends
x = A(4, 5) # A.__init__
just sets props; nothing else, but it always happens with A not B.x.prop #
Just reading the prop that was just set; same happens if not printed, just assigned y = x.prop# Long hang here, keyboard interrupt ends the hang, and the session continues
... # No problems here
quit()
The repl quits but the shell does not resume, and soon after the computer fan goes nuts with Python is using more CPU.
Another keyboard interrupt, and we see the following, after which the shell resumes and the computer quiets.
I'm baffled by this because my code is doing nothing basically. Yet it's the same A() that causes the hang every time...
Note that this does not occur in a standard Python repl, even with the same code. Something with the event loop? Thread handling? I'm wondering if this is related to #541.
Running on Mac OS X 12.6.1; Python 3.10 installed from homebrew.
I'm happy to answer any questions and would really appreciate any pointers on where to look or how to figure out what's happening. I've got people using the app/repl and would like to avoid random hangs.
Thanks (for your help and for ptpython)!
The text was updated successfully, but these errors were encountered: