[issue47029] Fix a BrokenPipeError when a multiprocessing.Queue is garbage collected

2022-03-16 Thread Géry
Géry added the comment: I forgot to include the output of the above program: ``` Traceback (most recent call last): File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/queues.py", line 251, in _feed send_bytes(obj) File

[issue47029] Fix a BrokenPipeError when a multiprocessing.Queue is garbage collected

2022-03-15 Thread Géry
Géry added the comment: I have attached the following patch: pass a reference to the reader end of the queue pipe to the queue thread so that the reader end is not garbage collected and closed before the queue thread has sent all the buffered data to the writer end. --

[issue47029] Fix a BrokenPipeError when a multiprocessing.Queue is garbage collected

2022-03-15 Thread Géry
Change by Géry : -- keywords: +patch pull_requests: +30006 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31913 ___ Python tracker ___

[issue47029] Fix a BrokenPipeError when a multiprocessing.Queue is garbage collected

2022-03-15 Thread Géry
New submission from Géry : A `BrokenPipeError` exception is raised when the queue thread of a `multiprocessing.Queue` still sends enqueued items to the write end of the queue pipe *after* the read end of the queue pipe has been [automatically closed during its garbage