mirror of
https://github.com/python/cpython.git
synced 2025-07-31 07:04:42 +00:00
#5471: fix expanduser() for $HOME set to "/".
This commit is contained in:
parent
a7ec0726e2
commit
3f0ef20269
3 changed files with 8 additions and 1 deletions
|
@ -345,6 +345,11 @@ class PosixPathTest(unittest.TestCase):
|
|||
self.assert_(isinstance(posixpath.expanduser("~root/"), basestring))
|
||||
self.assert_(isinstance(posixpath.expanduser("~foo/"), basestring))
|
||||
|
||||
orig_home = os.environ['HOME']
|
||||
os.environ['HOME'] = '/'
|
||||
self.assertEqual(posixpath.expanduser("~"), "/")
|
||||
os.environ['HOME'] = orig_home
|
||||
|
||||
self.assertRaises(TypeError, posixpath.expanduser)
|
||||
|
||||
def test_expandvars(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue