bpo-41094: Fix decoding errors with audit when open files. (GH-21095)

This commit is contained in:
Serhiy Storchaka 2020-06-24 08:46:05 +03:00 committed by GitHub
parent bf2e515fa4
commit 6c6810d989
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 35 additions and 14 deletions

View file

@ -1349,7 +1349,7 @@ class AuditingTests(EmbeddingTestsMixin, unittest.TestCase):
returncode=1)
def test_audit_run_interactivehook(self):
startup = os.path.join(self.oldcwd, support.TESTFN) + ".py"
startup = os.path.join(self.oldcwd, support.TESTFN) + (support.TESTFN or '') + ".py"
with open(startup, "w", encoding="utf-8") as f:
print("import sys", file=f)
print("sys.__interactivehook__ = lambda: None", file=f)
@ -1362,7 +1362,7 @@ class AuditingTests(EmbeddingTestsMixin, unittest.TestCase):
os.unlink(startup)
def test_audit_run_startup(self):
startup = os.path.join(self.oldcwd, support.TESTFN) + ".py"
startup = os.path.join(self.oldcwd, support.TESTFN) + (support.TESTFN or '') + ".py"
with open(startup, "w", encoding="utf-8") as f:
print("pass", file=f)
try: