aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_pathlib/support/local_path.py
diff options
context:
space:
mode:
authorBarney Gale <barney.gale@gmail.com>2025-04-28 20:18:56 +0100
committerGitHub <noreply@github.com>2025-04-28 20:18:56 +0100
commit336322b34137d90b0db19545c09a77f050ba8de0 (patch)
tree47c8efaea297dbe6e94f416b6490fbcfe9189fa8 /Lib/test/test_pathlib/support/local_path.py
parent606003ffa9e400cc22cc3b11f31118e2e24f688e (diff)
downloadcpython-336322b34137d90b0db19545c09a77f050ba8de0.tar.gz
cpython-336322b34137d90b0db19545c09a77f050ba8de0.zip
GH-128520: pathlib ABCs tests: use explicit text encoding (#133105)
Follow-up to fbffd70. Set `encoding='utf-8'` when reading and writing text in the tests for the private pathlib ABCs, which allows the tests to run with `-W error -X warn_default_encoding`
Diffstat (limited to 'Lib/test/test_pathlib/support/local_path.py')
-rw-r--r--Lib/test/test_pathlib/support/local_path.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_pathlib/support/local_path.py b/Lib/test/test_pathlib/support/local_path.py
index 4f027754f6a..d481fd45ead 100644
--- a/Lib/test/test_pathlib/support/local_path.py
+++ b/Lib/test/test_pathlib/support/local_path.py
@@ -82,7 +82,7 @@ class LocalPathGround:
readlink = staticmethod(os.readlink)
def readtext(self, p):
- with open(p, 'r') as f:
+ with open(p, 'r', encoding='utf-8') as f:
return f.read()
def readbytes(self, p):