New submission from Inada Naoki <songofaca...@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@python
components: Documentation
keywords: newcomer friendly
messages: 375033
nosy: docs@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue41507>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to