]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-128520: pathlib ABCs: validate `magic_open()` arguments (#131617)
authorBarney Gale <barney.gale@gmail.com>
Mon, 24 Mar 2025 15:13:18 +0000 (15:13 +0000)
committerGitHub <noreply@github.com>
Mon, 24 Mar 2025 15:13:18 +0000 (15:13 +0000)
commitd716ea34cb8a105e8e39a1ddfd610c3c0f11a0e7
treea81479395ecbdbb6c331f8c4ea3bf65130ad1e50
parentfbfb0e1f6efae7055f7420c999ad6256e10d6b62
GH-128520: pathlib ABCs: validate `magic_open()` arguments (#131617)

When `pathlib._os.magic_open()` is called to open a path in binary mode,
raise `ValueError` if any of the *encoding*, *errors* or *newline*
arguments are given. This matches the `open()` built-in.
Lib/pathlib/_os.py
Lib/test/test_pathlib/test_read.py
Lib/test/test_pathlib/test_write.py