New submission from Géry <[email protected]>:
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
collection](https://docs.python.org/3/library/socket.html#socket.socket.close)
following the garbage collection of the queue (the write end of the queue pipe
is not garbage collected because it is also referenced by the queue thread):
```
import multiprocessing
def main():
q = multiprocessing.Queue()
q.put(0)
if __name__ == '__main__':
main()
```
----------
components: Library (Lib)
messages: 415272
nosy: maggyero
priority: normal
severity: normal
status: open
title: Fix a BrokenPipeError when a multiprocessing.Queue is garbage collected
type: crash
versions: Python 3.10, Python 3.11, Python 3.9
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue47029>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com