Message375033
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." |
|
Date |
User |
Action |
Args |
2020-08-08 03:14:44 | methane | set | recipients:
+ methane, docs@python |
2020-08-08 03:14:44 | methane | set | messageid: <1596856484.75.0.552563820268.issue41507@roundup.psfhosted.org> |
2020-08-08 03:14:44 | methane | link | issue41507 messages |
2020-08-08 03:14:44 | methane | create | |
|