summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2019-08-29 05:06:49 (GMT)
committerGitHub <noreply@github.com>2019-08-29 05:06:49 (GMT)
commit465e5d5bcbfd42be058d3584ccb421405eba1594 (patch)
tree2d5f418adf5d865c45a860f61f78d8d24d983cf9 /Lib/test
parentb0caf329815120acf50287e29858093d328b0e3c (diff)
downloadcpython-465e5d5bcbfd42be058d3584ccb421405eba1594.zip
cpython-465e5d5bcbfd42be058d3584ccb421405eba1594.tar.gz
cpython-465e5d5bcbfd42be058d3584ccb421405eba1594.tar.bz2
bpo-37964: Make sure test works if TESTFN is in a non-ASCII directory. (GH-15568)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_fcntl.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_fcntl.py b/Lib/test/test_fcntl.py
index 38097db..a2b5997 100644
--- a/Lib/test/test_fcntl.py
+++ b/Lib/test/test_fcntl.py
@@ -147,9 +147,9 @@ class TestFcntl(unittest.TestCase):
@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)