This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author zanchey
Recipients zanchey
Date 2020-06-17.14:59:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1592405965.75.0.513458950808.issue41008@roundup.psfhosted.org>
In-reply-to
Content
On Windows 10 (1909, build 18363.900) in 3.7.7 and 3.9.0b3, poll() on a multiprocessing.Connection object can produce an exception:

--
import multiprocessing

def run(output_socket):
    for i in range(10):
        output_socket.send(i)
    output_socket.close()

def main():
    recv, send = multiprocessing.Pipe(duplex=False)
    process = multiprocessing.Process(target=run, args=(send,))
    process.start()
    send.close()

    while True:
        if not process._closed:
            if recv.poll():
                try:
                    print(recv.recv())
                except EOFError:
                    process.join()
                    break

if __name__ == "__main__":
    main()
--

On Linux/macOS this prints 0-9 and exits successfully, but on Windows produces a backtrace as follows:

  File "mptest.py", line 17, in main
    if recv.poll():
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.179.0_x64__qbz5n2kfra8p0\lib\multiprocessing\connection.py", line 262, in poll
    return self._poll(timeout)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.179.0_x64__qbz5n2kfra8p0\lib\multiprocessing\connection.py", line 333, in _poll
    _winapi.PeekNamedPipe(self._handle)[0] != 0):
BrokenPipeError: [WinError 109] The pipe has been ended
History
Date User Action Args
2020-06-17 14:59:25zancheysetrecipients: + zanchey
2020-06-17 14:59:25zancheysetmessageid: <1592405965.75.0.513458950808.issue41008@roundup.psfhosted.org>
2020-06-17 14:59:25zancheylinkissue41008 messages
2020-06-17 14:59:25zancheycreate