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

Use utf-8 in "Reading and Writing Files" tutorial. #85679

Closed
methane opened this issue Aug 8, 2020 · 1 comment · Fixed by #91778
Closed

Use utf-8 in "Reading and Writing Files" tutorial. #85679

methane opened this issue Aug 8, 2020 · 1 comment · Fixed by #91778
Labels
3.9 only security fixes 3.10 only security fixes docs Documentation in the Doc dir easy type-feature A feature request or enhancement

Comments

@methane
Copy link
Member

methane commented Aug 8, 2020

BPO 41507
Nosy @methane

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 = None
created_at = <Date 2020-08-08.03:14:44.706>
labels = ['easy', '3.8', '3.9', '3.10', 'type-feature', 'docs']
title = 'Use utf-8 in "Reading and Writing Files" tutorial.'
updated_at = <Date 2020-08-08.03:14:44.706>
user = 'https://github.com/methane'

bugs.python.org fields:

activity = <Date 2020-08-08.03:14:44.706>
actor = 'methane'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2020-08-08.03:14:44.706>
creator = 'methane'
dependencies = []
files = []
hgrepos = []
issue_num = 41507
keywords = ['newcomer friendly']
message_count = 1.0
messages = ['375033']
nosy_count = 2.0
nosy_names = ['methane', 'docs@python']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue41507'
versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

@methane
Copy link
Member Author

methane commented Aug 8, 2020

https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files

Current tutorial doesn't mention about encoding and example uses locale encoding.
Since UTF-8 is major text encoding and many Windows environment doesn't use UTF-8 by default, encoding should be mentioned in the tutorial and UTF-8 should be recommended.

Additionally, the paragraph about line ending conversion [1] can be removed. This was important in Python 2. But it is not important because (en|de)coding binary data is nonsense already.

[1]: "This behind-the-scenes modification to file data is fine for text files, but will corrupt binary data like that in JPEG or EXE files. Be very careful to use binary mode when reading and writing such files."

@methane methane added 3.8 (EOL) end of life 3.9 only security fixes 3.10 only security fixes labels Aug 8, 2020
@methane methane added docs Documentation in the Doc dir easy 3.8 (EOL) end of life type-feature A feature request or enhancement 3.9 only security fixes 3.10 only security fixes labels Aug 8, 2020
@methane methane added docs Documentation in the Doc dir easy type-feature A feature request or enhancement labels Aug 8, 2020
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@methane methane removed the 3.8 (EOL) end of life label Apr 20, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 2, 2022
)

(cherry picked from commit 614420d)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
miss-islington added a commit that referenced this issue May 2, 2022
(cherry picked from commit 614420d)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
miss-islington added a commit that referenced this issue May 2, 2022
(cherry picked from commit 614420d)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
hello-adam pushed a commit to hello-adam/cpython that referenced this issue Jun 2, 2022
)

(cherry picked from commit 614420d)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.9 only security fixes 3.10 only security fixes docs Documentation in the Doc dir easy type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant