Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e9e8c9b

Browse files
committed
#10739: document that on Windows, socket.makefile() does not make a file that has a true file descriptor usable where such a thing is expected.
1 parent 9d9848e commit e9e8c9b

2 files changed

Lines changed: 15 additions & 8 deletions

File tree

Doc/ACKS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ [email protected]), and we'll be glad to correct the problem.
111111
* Andrew M. Kuchling
112112
* Dave Kuhlman
113113
* Erno Kuusela
114+
* Ross Lagerwall
114115
* Thomas Lamb
115116
* Detlef Lannert
116117
* Piers Lauder

Doc/library/socket.rst

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -634,18 +634,24 @@ correspond to Unix system calls applicable to sockets.
634634
is system-dependent (usually 5).
635635

636636

637-
.. method:: socket.makefile(mode='r', buffering=None, *, encoding=None, errors=None, newline=None)
637+
.. method:: socket.makefile(mode='r', buffering=None, *, encoding=None, \
638+
errors=None, newline=None)
638639

639640
.. index:: single: I/O control; buffering
640641

641-
Return a :term:`file object` associated with the socket. The exact
642-
returned type depends on the arguments given to :meth:`makefile`. These
643-
arguments are interpreted the same way as by the built-in :func:`open`
644-
function.
642+
Return a :term:`file object` associated with the socket. The exact returned
643+
type depends on the arguments given to :meth:`makefile`. These arguments are
644+
interpreted the same way as by the built-in :func:`open` function.
645645

646-
Closing the file object won't close the socket unless there are no
647-
remaining references to the socket. The socket must be in blocking mode
648-
(it can not have a timeout).
646+
Closing the file object won't close the socket unless there are no remaining
647+
references to the socket. The socket must be in blocking mode (it can not
648+
have a timeout).
649+
650+
.. note::
651+
652+
On Windows, the file-like object created by :meth:`makefile` cannot be
653+
used where a file object with a file descriptor is expected, such as the
654+
stream arguments of :meth:`subprocess.Popen`.
649655

650656

651657
.. method:: socket.recv(bufsize[, flags])

0 commit comments

Comments
 (0)