Message368370
The following program frequently raises a ProcessLookupError exception when calling proc.terminate():
```
import threading
import subprocess
import multiprocessing
proc = subprocess.Popen(["sh", "-c", "exit 0"])
q = multiprocessing.Queue()
def communicate_thread(proc):
proc.communicate()
t = threading.Thread(target=communicate_thread, args=(proc,))
t.start()
proc.terminate()
t.join()
```
I'm reproducing this with Python 3.8.2 on Arch Linux by saving the script and rapidly executing it like this:
$ bash -e -c "while true; do python3 test.py; done
The (unused) multiprocessing.Queue seems to play a role here because the problem vanishes when removing that one line. |
|
Date |
User |
Action |
Args |
2020-05-07 20:01:24 | Alexander Overvoorde | set | recipients:
+ Alexander Overvoorde |
2020-05-07 20:01:24 | Alexander Overvoorde | set | messageid: <1588881684.43.0.416849020134.issue40550@roundup.psfhosted.org> |
2020-05-07 20:01:24 | Alexander Overvoorde | link | issue40550 messages |
2020-05-07 20:01:24 | Alexander Overvoorde | create | |
|