Issue 14303: Incorrect documentation for socket.py on linux (original) (raw)

Issue14303

Created on 2012-03-14 16:58 by Shane.Hansen, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test.py Shane.Hansen,2012-03-14 16:58 script which asserts that dup() was called and the object returned by makefile has a different fileno() than the socket.
Messages (3)
msg155768 - (view) Author: Shane Hansen (Shane.Hansen) Date: 2012-03-14 16:58
The python docs state that for socket.makefile "The file object references a dup()ped version of the socket file descriptor, so the file object and socket object may be closed or garbage-collected independently." In fact for socket.py dup() is never called, and no additional files are opened. Instead an object is returned which uses the original socket and does buffering. For me, this is the desired behaviour, but just thought I'd mention the docs were off.
msg228592 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-10-05 17:27
Shane, there are major differences between the makefile docs versions 2 and 3, so could you prepare a patch for this addressed at version 2 only?
msg228697 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-10-06 14:37
New changeset 6e2a72e05b4f by Georg Brandl in branch '2.7': Closes #14303: socket.makefile() does not call dup() anymore on the socket fd. https://hg.python.org/cpython/rev/6e2a72e05b4f
History
Date User Action Args
2022-04-11 14:57:28 admin set github: 58511
2014-10-06 14:37:04 python-dev set status: open -> closednosy: + python-devmessages: + resolution: fixedstage: resolved
2014-10-05 17:27:53 BreamoreBoy set nosy: + BreamoreBoymessages: + versions: - Python 2.6
2013-06-15 05:29:55 eric.snow set nosy: + eric.snow
2012-03-14 16:58:17 Shane.Hansen create