[3.9] bpo-41069: Make TESTFN and the CWD for tests containing non-ascii characters. (GH-21035). (GH-21156)
(cherry picked from commit 700cfa8c90a90016638bac13c4efd03786b2b2a0)
diff --git a/Lib/test/test_binhex.py b/Lib/test/test_binhex.py
index 8595532..591f32a 100644
--- a/Lib/test/test_binhex.py
+++ b/Lib/test/test_binhex.py
@@ -13,9 +13,10 @@
class BinHexTestCase(unittest.TestCase):
def setUp(self):
- self.fname1 = support.TESTFN + "1"
- self.fname2 = support.TESTFN + "2"
- self.fname3 = support.TESTFN + "very_long_filename__very_long_filename__very_long_filename__very_long_filename__"
+ # binhex supports only file names encodable to Latin1
+ self.fname1 = support.TESTFN_ASCII + "1"
+ self.fname2 = support.TESTFN_ASCII + "2"
+ self.fname3 = support.TESTFN_ASCII + "very_long_filename__very_long_filename__very_long_filename__very_long_filename__"
def tearDown(self):
support.unlink(self.fname1)