Roundup Robot added the comment:
New changeset a7391c31ec4e by Berker Peksag in branch '3.5':
Issue #16915: Clarify that mode parameter of socket.makefile() does not accept
https://hg.python.org/cpython/rev/a7391c31ec4e
New changeset bbfbde6ee9d0 by Berker Peksag in branch 'default':
Issue
Berker Peksag added the comment:
Thanks for the report and for the patch. I would prefer to keep the code simple
so I just applied documentation changes with a minor tweak.
--
assignee: -> docs@python
components: +Documentation -Library (Lib)
nosy: +berker.peksag, docs@python
Antoon Pardon added the comment:
I think one could argue for allowing mode r+ instead of wb. Because w
suggest truncation, which doesn't make sense on sockets either.
But in the end I agree that allowing 'r', 'w', 'b' and 't' is probably the best
compromise available.
--
Federico Reghenzani added the comment:
I think that 't' option can be added to conform with open() built-in function.
The other options I don't think it's possible to use with sockets.
Adding the 't' doesn't change the makefile() behavior. I added also a
clarification in documentation.
New submission from Antoon Pardon:
The documentation of socket.makefile states that its arguments are interpreted
the same way as by the built-in open() function. However the mode argument of
socket.makefile only allows 'r', 'w' and 'b'.
That some options are not allowed seems perfectly