]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-101881: Support (non-)blocking read/write functions on Windows pipes (GH-101882)
authorRayyan Ansari <rayyan@ansari.sh>
Thu, 16 Feb 2023 14:52:24 +0000 (14:52 +0000)
committerGitHub <noreply@github.com>
Thu, 16 Feb 2023 14:52:24 +0000 (14:52 +0000)
commit739c026f4488bd2e37d500a2c3d948aaf929b641
tree733937b9fe265101f480e7a2480d427c1909cbac
parent36b139af638cdeb671cb6b8b0315b254148688f7
gh-101881: Support (non-)blocking read/write functions on Windows pipes (GH-101882)

* fileutils: handle non-blocking pipe IO on Windows

Handle erroring operations on non-blocking pipes by reading the _doserrno code.
Limit writes on non-blocking pipes that are too large.

* Support blocking functions on Windows

Use the GetNamedPipeHandleState and SetNamedPipeHandleState Win32 API functions to add support for os.get_blocking and os.set_blocking.
Doc/library/os.rst
Include/internal/pycore_fileutils.h
Lib/test/test_os.py
Misc/NEWS.d/next/Windows/2023-02-13-18-05-49.gh-issue-101881._TnHzN.rst [new file with mode: 0644]
Misc/NEWS.d/next/Windows/2023-02-15-11-08-10.gh-issue-101881.fScr3m.rst [new file with mode: 0644]
Modules/clinic/posixmodule.c.h
Modules/posixmodule.c
Python/fileutils.c