cpython: 75111791110b (original) (raw)

--- a/Lib/posixpath.py +++ b/Lib/posixpath.py @@ -186,7 +186,7 @@ def ismount(path): return False try: s1 = os.lstat(path)

--- a/Lib/test/test_posixpath.py +++ b/Lib/test/test_posixpath.py @@ -1,4 +1,5 @@ import unittest +from test import symlink_support from test import test_support, test_genericpath from test import test_support as support @@ -7,6 +8,11 @@ import os import sys from posixpath import realpath, abspath, dirname, basename +try:

+except ImportError:

+

An absolute path to a temporary filename for testing. We can't rely on TESTFN

being an absolute path, so we need this.

@@ -100,7 +106,7 @@ class PosixPathTest(unittest.TestCase): f.write("foo") f.close() self.assertIs(posixpath.islink(test_support.TESTFN + "1"), False)

@@ -196,6 +202,64 @@ class PosixPathTest(unittest.TestCase): def test_ismount(self): self.assertIs(posixpath.ismount("/"), True)

+

+

+

+ def test_expanduser(self): self.assertEqual(posixpath.expanduser("foo"), "foo") with test_support.EnvironmentVarGuard() as env:

--- a/Misc/ACKS +++ b/Misc/ACKS @@ -1186,6 +1186,7 @@ Guido van Rossum Just van Rossum Hugo van Rossum Saskia van Rossum +Robin Roth Clement Rouault Donald Wallace Rouse II Liam Routt

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -33,6 +33,9 @@ Core and Builtins Library ------- +- Issue #2466: posixpath.ismount now correctly recognizes mount points which