Message375298
I experience a problem with multiprocessing and print.
I tried to make a minimal working example, please see the attached file.
WITHOUT the offending print statement in the queue filler thread, everything works:
- pytest experiments/mp_problem.py
- pytest experiments/mp_problem.py -s
- python experiments/mp_problem.py
WITH the offending print statement, not so much:
- pytest experiments/mp_problem.py WORKS (Probably because pytest captures fd 1)
- pytest experiments/mp_problem.py -s FAILS eventually (after a couple of workers have been started)
- python experiments/mp_problem.py FAILS eventually (same).
WITH the offending print statement AND PYTHONUNBUFFERED=1, everything works again:
- pytest experiments/mp_problem.py
- pytest experiments/mp_problem.py -s
- python experiments/mp_problem.py
Environment:
Ubuntu 18.04.5 LTS
python 3.8.5 (hcff3b4d_1) on conda 4.8.3 |
|
Date |
User |
Action |
Args |
2020-08-13 09:42:10 | moi90 | set | recipients:
+ moi90 |
2020-08-13 09:42:10 | moi90 | set | messageid: <1597311730.71.0.906884435677.issue41539@roundup.psfhosted.org> |
2020-08-13 09:42:10 | moi90 | link | issue41539 messages |
2020-08-13 09:42:10 | moi90 | create | |
|