From: Berker Peksag Date: Fri, 11 Mar 2016 21:07:27 +0000 (+0200) Subject: Issue #20589: Invoking Path.owner() and Path.group() on Windows now raise X-Git-Tag: v3.6.0a1~502^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=04d4229719055c9536da6d4b58033981ef86d0d2;p=thirdparty%2FPython%2Fcpython.git Issue #20589: Invoking Path.owner() and Path.group() on Windows now raise NotImplementedError instead of ImportError. --- diff --git a/Lib/pathlib.py b/Lib/pathlib.py index 5169ff5e6335..ed31ddb8dd8c 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -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") diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py index b03fee018f3c..8ba9c8f3a795 100644 --- a/Lib/test/test_pathlib.py +++ b/Lib/test/test_pathlib.py @@ -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 diff --git a/Misc/NEWS b/Misc/NEWS index b9641816efde..3d9a78735cc6 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -91,6 +91,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 #15068: Got rid of excessive buffering in the fileinput module.