Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rephrase sentence in tutorial about universal newlines #60470

Closed
fossilet mannequin opened this issue Oct 17, 2012 · 7 comments
Closed

Rephrase sentence in tutorial about universal newlines #60470

fossilet mannequin opened this issue Oct 17, 2012 · 7 comments
Labels
docs Documentation in the Doc dir easy type-feature A feature request or enhancement

Comments

@fossilet
Copy link
Mannequin

fossilet mannequin commented Oct 17, 2012

BPO 16266
Nosy @asvetlov, @cjerdonek

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2012-10-18.03:33:00.408>
created_at = <Date 2012-10-17.12:58:39.828>
labels = ['easy', 'type-feature', 'docs']
title = 'Rephrase sentence in tutorial about universal newlines'
updated_at = <Date 2012-10-18.03:33:00.407>
user = 'https://bugs.python.org/fossilet'

bugs.python.org fields:

activity = <Date 2012-10-18.03:33:00.407>
actor = 'chris.jerdonek'
assignee = 'docs@python'
closed = True
closed_date = <Date 2012-10-18.03:33:00.408>
closer = 'chris.jerdonek'
components = ['Documentation']
creation = <Date 2012-10-17.12:58:39.828>
creator = 'fossilet'
dependencies = []
files = []
hgrepos = []
issue_num = 16266
keywords = ['easy']
message_count = 7.0
messages = ['173165', '173169', '173186', '173187', '173192', '173227', '173228']
nosy_count = 5.0
nosy_names = ['fossilet', 'asvetlov', 'chris.jerdonek', 'docs@python', 'python-dev']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue16266'
versions = ['Python 3.2', 'Python 3.3', 'Python 3.4']

@fossilet
Copy link
Mannequin Author

fossilet mannequin commented Oct 17, 2012

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?

@fossilet fossilet mannequin added the type-bug An unexpected behavior, bug, or error label Oct 17, 2012
@fossilet fossilet mannequin assigned docspython Oct 17, 2012
@fossilet fossilet mannequin added the docs Documentation in the Doc dir label Oct 17, 2012
@asvetlov
Copy link
Contributor

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.

@cjerdonek
Copy link
Member

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.

@cjerdonek
Copy link
Member

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."

@cjerdonek cjerdonek added the easy label Oct 17, 2012
@cjerdonek cjerdonek changed the title Typo in tutorial Rephrase sentence in tutorial about universal newlines Oct 17, 2012
@asvetlov
Copy link
Contributor

Looks good to me, please apply it.

@python-dev
Copy link
Mannequin

python-dev mannequin commented Oct 18, 2012

New changeset 7b2a13b20b33 by Chris Jerdonek in branch '3.2':
Clarify universal-newline wording in tutorial (issue bpo-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 bpo-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 bpo-16266).
http://hg.python.org/cpython/rev/a45cb181e4d0

@cjerdonek
Copy link
Member

Committed. Thanks for the report!

@cjerdonek cjerdonek added type-feature A feature request or enhancement and removed type-bug An unexpected behavior, bug, or error labels Oct 18, 2012
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir easy type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants