[Python-checkins] bpo-37964: Make sure test works if TESTFN is in a non-ASCII directory. (GH-15568)

Benjamin Peterson webhook-mailer at python.org
Thu Aug 29 01:06:53 EDT 2019


https://github.com/python/cpython/commit/465e5d5bcbfd42be058d3584ccb421405eba1594
commit: 465e5d5bcbfd42be058d3584ccb421405eba1594
branch: master
author: Benjamin Peterson <benjamin at python.org>
committer: GitHub <noreply at github.com>
date: 2019-08-28T22:06:49-07:00
summary:

bpo-37964: Make sure test works if TESTFN is in a non-ASCII directory. (GH-15568)

files:
M Lib/test/test_fcntl.py

diff --git a/Lib/test/test_fcntl.py b/Lib/test/test_fcntl.py
index 38097dbdfb97..a2b599706753 100644
--- a/Lib/test/test_fcntl.py
+++ b/Lib/test/test_fcntl.py
@@ -147,9 +147,9 @@ def test_flock_overflow(self):
     @unittest.skipIf(sys.platform != 'darwin', "F_GETPATH is only available on macos")
     def test_fcntl_f_getpath(self):
         self.f = open(TESTFN, 'wb')
-        abspath = os.path.abspath(TESTFN)
-        res = fcntl.fcntl(self.f.fileno(), fcntl.F_GETPATH, bytes(len(abspath)))
-        self.assertEqual(abspath, res.decode('utf-8'))
+        expected = os.path.abspath(TESTFN).encode('utf-8')
+        res = fcntl.fcntl(self.f.fileno(), fcntl.F_GETPATH, bytes(len(expected)))
+        self.assertEqual(expected, res)
 
 def test_main():
     run_unittest(TestFcntl)



More information about the Python-checkins mailing list