[New-bugs-announce] [issue41507] Use utf-8 in "Reading and Writing Files" tutorial.

Inada Naoki report at bugs.python.org
Fri Aug 7 23:14:44 EDT 2020


New submission from Inada Naoki <songofacandy at gmail.com>:

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

----------
assignee: docs at python
components: Documentation
keywords: newcomer friendly
messages: 375033
nosy: docs at python, inada.naoki
priority: normal
severity: normal
status: open
title: Use utf-8 in "Reading and Writing Files" tutorial.
type: enhancement
versions: Python 3.10, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41507>
_______________________________________


More information about the New-bugs-announce mailing list