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`
This commit is contained in:
Barney Gale 2025-04-28 20:18:56 +01:00 committed by GitHub
parent 606003ffa9
commit 336322b341
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 13 deletions

View file

@ -82,7 +82,7 @@ def create_hierarchy(self, p):
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):