#5471: fix expanduser() for $HOME set to "/".

This commit is contained in:
Georg Brandl 2009-04-05 14:48:49 +00:00
parent a7ec0726e2
commit 3f0ef20269
3 changed files with 8 additions and 1 deletions

View file

@ -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):