[issue15624] clarify io.TextIOWrapper newline documentation
New submission from Chris Jerdonek: The documentation of io.TextIOWrapper's newline argument is somewhat confusing and perhaps reversed from what was intended. (For example, the subprocess module uses the reverse terminology.) Either way, it can be improved somewhat. Currently, it says-- "* On input, if newline is None,... Lines in the input can end in '\n', '\r', or '\r\n', and these are translated into '\n' before being returned to the caller... * On output, if newline is None, any '\n' characters written are translated to the system default line separator, os.linesep..." (from http://docs.python.org/dev/library/io.html#io.TextIOWrapper ) It is somewhat confusing because "On input" does not mean "On input to the buffer," and "On output" does not mean "On output from the buffer." It is the reverse. A minimal change to address this would be something along the lines of-- "On input" -> "When reading input from the buffer" "On output" -> "When writing output to the buffer The same change could also be made to the open() documentation: http://docs.python.org/dev/library/functions.html#open I can prepare a patch for affected versions. ---------- assignee: docs@python components: Documentation keywords: easy messages: 167995 nosy: cjerdonek, docs@python priority: normal severity: normal status: open title: clarify io.TextIOWrapper newline documentation _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue15624> _______________________________________
Chris Jerdonek added the comment: Andrew, I'm adding you because this is the documentation that the subprocess module will point to after issue 15561. ---------- nosy: +asvetlov _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue15624> _______________________________________
Andrew Svetlov added the comment: For me input means «reading from» and output — «writing to». Nevertheless I'm ok with you suggestion. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue15624> _______________________________________
Changes by Andrew Svetlov <andrew.svetlov@gmail.com>: ---------- title: clarify io.TextIOWrapper newline documentation -> clarify newline documentation for open and io.TextIOWrapper. _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue15624> _______________________________________
Roundup Robot added the comment: New changeset 5b629e9fde61 by Andrew Svetlov in branch '3.2': Issue #15624: clarify newline documentation for open and io.TextIOWrapper http://hg.python.org/cpython/rev/5b629e9fde61 New changeset 9e098890ea2c by Andrew Svetlov in branch 'default': Issue #15624: clarify newline documentation for open and io.TextIOWrapper http://hg.python.org/cpython/rev/9e098890ea2c ---------- nosy: +python-dev _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue15624> _______________________________________
Andrew Svetlov added the comment: Close as fixed. Thanks. ---------- resolution: -> fixed stage: -> committed/rejected status: open -> closed versions: +Python 3.2, Python 3.3 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue15624> _______________________________________
Chris Jerdonek added the comment: Thanks a lot, Andrew. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue15624> _______________________________________
participants (3)
-
Andrew Svetlov
-
Chris Jerdonek
-
Roundup Robot