mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
#3426: os.path.abspath now returns unicode when its arg is unicode.
This commit is contained in:
parent
61afd2694b
commit
4cc80ca921
8 changed files with 57 additions and 6 deletions
|
@ -8,6 +8,16 @@ class MacPathTestCase(unittest.TestCase):
|
|||
def test_abspath(self):
|
||||
self.assertTrue(macpath.abspath("xx:yy") == "xx:yy")
|
||||
|
||||
# Issue 3426: check that abspath retuns unicode when the arg is unicode
|
||||
# and str when it's str, with both ASCII and non-ASCII cwds
|
||||
for cwd in (u'cwd', u'\xe7w\xf0'):
|
||||
with test_support.temp_cwd(cwd):
|
||||
for path in ('', 'foo', 'f\xf2\xf2', '/foo', 'C:\\'):
|
||||
self.assertIsInstance(macpath.abspath(path), str)
|
||||
for upath in (u'', u'fuu', u'f\xf9\xf9', u'/fuu', u'U:\\'):
|
||||
self.assertIsInstance(macpath.abspath(upath), unicode)
|
||||
|
||||
|
||||
def test_isabs(self):
|
||||
isabs = macpath.isabs
|
||||
self.assertTrue(isabs("xx:yy"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue