Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
On Windows, several calls toos.stat() on the named pipe used byasyncio.ProactorEventLoop.start_serving_pipe() will result in anOSError. At this time, the first call toos.stat() will cause aBrokenPipeError on the server side.
Steps to reproduce
Run the pipe server in Command Prompt:
>type pipe_server.pyimport asyncioasync def start_server(): pipe = r'\\.\pipe\_test_pipe_server' loop = asyncio.get_event_loop() await loop.start_serving_pipe(asyncio.Protocol, pipe) await asyncio.sleep(3600)asyncio.run(start_server())>python pipe_server.pyRun the following script as client on another Command Prompt:
>type pipe_stat.pyimport ospipe = r'\\.\pipe\_test_pipe_server'os.stat(pipe)>python pipe_stat.pyDisplay the following messages on the server side:
Pipe accept failedpipe: <PipeHandle handle=368>Traceback (most recent call last): File "d:\python_build\Python-3.9.13\lib\asyncio\windows_events.py", line 368, in loop_accept_pipe f = self._proactor.accept_pipe(pipe) File "d:\python_build\Python-3.9.13\lib\asyncio\windows_events.py", line 636, in accept_pipe connected = ov.ConnectNamedPipe(pipe.fileno())BrokenPipeError: [WinError 232] The pipe is being closedOn client side, runpipe_stat.py repeat several times, thenOSError occured:
Traceback (most recent call last): File "C:\Users\<user>\Desktop\pipe_stat.py", line 4, in <module> os.stat(pipe)OSError: [WinError 231] All pipe instances are busy: '\\\\.\\pipe\\_test_pipe_server'This problem seems to stem from commit9eb3d54 between 3.8.0b3 and 3.8.0b4.
Your environment
- CPython versions tested on: 3.8.0b3+(9eb3d54), 3.8.0, 3.9.13, 3.10.9, 3.11.1
- Operating system and architecture: Windows 10 x64
Linked PRs
Metadata
Metadata
Assignees
Projects
Status
Done