Skip to content

Commit 5796270

Browse files
authored
PEP 680: Further explain why files are read as binary (GH-2281)
1 parent ea50689 commit 5796270

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pep-0680.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,9 @@ be worked around in user code, or by using a third-party library.
289289

290290
The proposed API takes a binary file, while ``toml.load`` takes a text file and
291291
``json.load`` takes either. Using a binary file allows us to ensure UTF-8 is
292-
the encoding used, and avoid incorrectly parsing single carriage returns as
293-
valid TOML due to universal newlines in text mode.
292+
the encoding used (ensuring correct parsing on platforms with other default
293+
encodings, such as Windows), and avoid incorrectly parsing files containing
294+
single carriage returns as valid TOML due to universal newlines in text mode.
294295

295296

296297
Type accepted as the first argument of ``tomllib.loads``

0 commit comments

Comments
 (0)