Issue #20589: Invoking Path.owner() and Path.group() on Windows now raise

NotImplementedError instead of ImportError.
This commit is contained in:
Berker Peksag 2016-03-11 23:08:11 +02:00
commit d0e9b6919f
3 changed files with 18 additions and 0 deletions

View File

@ -1425,3 +1425,9 @@ class PosixPath(Path, PurePosixPath):
class WindowsPath(Path, PureWindowsPath):
__slots__ = ()
def owner(self):
raise NotImplementedError("Path.owner() is unsupported on this system")
def group(self):
raise NotImplementedError("Path.group() is unsupported on this system")

View File

@ -1156,6 +1156,15 @@ class PureWindowsPathTest(_BasePurePathTest, unittest.TestCase):
# UNC paths are never reserved
self.assertIs(False, P('//my/share/nul/con/aux').is_reserved())
def test_owner(self):
P = self.cls
with self.assertRaises(NotImplementedError):
P('c:/').owner()
def test_group(self):
P = self.cls
with self.assertRaises(NotImplementedError):
P('c:/').group()
class PurePathTest(_BasePurePathTest, unittest.TestCase):
cls = pathlib.PurePath

View File

@ -201,6 +201,9 @@ Core and Builtins
Library
-------
- Issue #20589: Invoking Path.owner() and Path.group() on Windows now raise
NotImplementedError instead of ImportError.
- Issue #26177: Fixed the keys() method for Canvas and Scrollbar widgets.
- Issue #21042: Make ctypes.util.find_library() return the full path on