summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_os.py
diff options
context:
space:
mode:
authorBrian Curtin <brian.curtin@gmail.com>2010-11-28 23:59:46 (GMT)
committerBrian Curtin <brian.curtin@gmail.com>2010-11-28 23:59:46 (GMT)
commitfc889c48edc17b9502c0aef416ce2d003dbef4e6 (patch)
tree88f633faaa267ca02024a06cae0849924bbfe730 /Lib/test/test_os.py
parent1de911592ee52affd6b855d7325af46559f23407 (diff)
downloadcpython-fc889c48edc17b9502c0aef416ce2d003dbef4e6.zip
cpython-fc889c48edc17b9502c0aef416ce2d003dbef4e6.tar.gz
cpython-fc889c48edc17b9502c0aef416ce2d003dbef4e6.tar.bz2
Fix for #8879.
Amaury noticed that this was originally written in a way that would fail on names that can't be encoded with the mbcs codec. Restructured the function to work with wide names first then narrow names second, to fall in line with the way other functions are written in posixmodule.c.
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r--Lib/test/test_os.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 978364c..5a37522 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -887,6 +887,11 @@ class LinkTests(unittest.TestCase):
self._test_link(bytes(self.file1, sys.getfilesystemencoding()),
bytes(self.file2, sys.getfilesystemencoding()))
+ def test_mbcs_name(self):
+ self.file1 += "\u65e5\u672c"
+ self.file2 = self.file1 + "2"
+ self._test_link(self.file1, self.file2)
+
if sys.platform != 'win32':
class Win32ErrorTests(unittest.TestCase):
pass