Issue 16266: Rephrase sentence in tutorial about universal newlines (original) (raw)

Created on 2012-10-17 12:58 by fossilet, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (7)
msg173165 - (view) Author: Yongzhi Pan (fossilet) * Date: 2012-10-17 12:58
http://docs.python.org/py3k/tutorial/inputoutput.html#reading-and-writing-files The text: In text mode, the default is to convert platform-specific line endings (\n on Unix, \r\n on Windows) to just \n on reading and \n back to platform-specific line endings on writing. Is the last '\n' a typo and not needed?
msg173169 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2012-10-17 13:12
I'm not native English speaker, but for me it just means \r\n -> \n when read from stream and \n -> \r\n when write to stream if OS is Windows. That's correct.
msg173186 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-10-17 17:12
The last \n is needed for the reason Andrew mentioned, but it is true that the sentence could probably be rephrased to reduce the chance of confusion.
msg173187 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-10-17 17:40
I would suggest something like this: "In text mode, the default when reading is to convert platform-specific line endings (\n on Unix, \r\n on Windows) to just \n. When writing in text mode, the default is to convert occurrences of \n back to platform-specific line endings."
msg173192 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2012-10-17 18:38
Looks good to me, please apply it.
msg173227 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-10-18 03:31
New changeset 7b2a13b20b33 by Chris Jerdonek in branch '3.2': Clarify universal-newline wording in tutorial (issue #16266). http://hg.python.org/cpython/rev/7b2a13b20b33 New changeset b5439bca219f by Chris Jerdonek in branch '3.3': Merge from 3.2: clarify universal-newline wording in tutorial (issue #16266). http://hg.python.org/cpython/rev/b5439bca219f New changeset a45cb181e4d0 by Chris Jerdonek in branch 'default': Merge from 3.3: clarify universal-newline wording in tutorial (issue #16266). http://hg.python.org/cpython/rev/a45cb181e4d0
msg173228 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-10-18 03:33
Committed. Thanks for the report!
History
Date User Action Args
2022-04-11 14:57:37 admin set github: 60470
2012-10-18 03:33:00 chris.jerdonek set status: open -> closedtype: behavior -> enhancementmessages: + resolution: fixedstage: resolved
2012-10-18 03:31:10 python-dev set nosy: + python-devmessages: +
2012-10-17 18:38:58 asvetlov set messages: +
2012-10-17 17:40:14 chris.jerdonek set keywords: + easytitle: Typo in tutorial -> Rephrase sentence in tutorial about universal newlinesmessages: + versions: + Python 3.4
2012-10-17 17:12:45 chris.jerdonek set messages: +
2012-10-17 13:12:46 asvetlov set nosy: + asvetlov, chris.jerdonekmessages: +
2012-10-17 12:58:39 fossilet create