[New-bugs-announce] [issue43409] [Win] Call subprocess.Popen() twice makes Thread.join() interruptible and deadlock

Zhang Boyang report at bugs.python.org
Fri Mar 5 11:16:07 EST 2021


New submission from Zhang Boyang <zhangboyang.id at gmail.com>:

Please run joinbug.py and press Ctrl-C twice.

============= The output  =============

1st join
PLEASE PRESS CTRL-C TWICE, IGNORE THE 'Press any key to continue'
Press any key to continue . . . Press any key to continue . . .

thread exit
Traceback (most recent call last):
  File "D:\xxx\joinbug.py", line 21, in <module>
    t.join() # subprocess.Popen() makes join() can be interrupted
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python39\lib\threading.py", line 1033, in join
    self._wait_for_tstate_lock()
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python39\lib\threading.py", line 1049, in _wait_for_tstate_lock
    elif lock.acquire(block, timeout):
KeyboardInterrupt
2nd join
(stuck here)


============= Expected behaviour =============
either join uninterruptible
or the 2nd join doesn't deadlock.

----------
components: Windows
files: joinbug.py
messages: 388156
nosy: paul.moore, steve.dower, tim.golden, zach.ware, zby1234
priority: normal
severity: normal
status: open
title: [Win] Call subprocess.Popen() twice makes Thread.join() interruptible and deadlock
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file49853/joinbug.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43409>
_______________________________________


More information about the New-bugs-announce mailing list