classification
Title: newline is (partially) independent of universal newlines; needs to be made more clear in docs
Type: enhancement Stage: needs patch
Components: Documentation Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Devin Jeanpierre, docs@python, twouters
Priority: normal Keywords:

Created on 2014-02-21 13:24 by Devin Jeanpierre, last changed 2018-05-03 14:16 by cheryl.sabella.

Messages (2)
msg211854 - (view) Author: Devin Jeanpierre (Devin Jeanpierre) * Date: 2014-02-21 13:24
http://docs.python.org/3.4/library/functions.html#open says "newline controls how universal newlines mode works (it only applies to text mode)."

My reading of this when I saw it was that newline= doesn't do anything unless universal newlines mode is enabled. This is untrue, and you can infer it's untrue from the following lines, but then the docs appear to contradict themselves. Please fix to say something more along the lines of "newline controls how newlines are read and written. It only applies to text mode."

The interactions with universal newlines mode are explained in the following text, so they don't need to be called out upfront. newline does more than just that.
msg211857 - (view) Author: Thomas Wouters (twouters) * (Python committer) Date: 2014-02-21 13:26
Additionally, the deprecation notice for 'U' in the table of modules should mention that the 'U' mode, not universal newlines, is deprecated because it is unnecessary. Or 'controlled by the newline argument' perhaps.
History
Date User Action Args
2018-05-03 14:16:13cheryl.sabellasetstage: needs patch
type: enhancement
versions: + Python 3.8, - Python 3.4
2014-02-21 13:26:51twouterssetnosy: + twouters
messages: + msg211857
2014-02-21 13:24:07Devin Jeanpierrecreate