mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-41094: Fix decoding errors with audit when open files. (GH-21095)
This commit is contained in:
parent
bf2e515fa4
commit
6c6810d989
5 changed files with 35 additions and 14 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue