]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #20589: Invoking Path.owner() and Path.group() on Windows now raise
authorBerker Peksag <berker.peksag@gmail.com>
Fri, 11 Mar 2016 21:07:27 +0000 (23:07 +0200)
committerBerker Peksag <berker.peksag@gmail.com>
Fri, 11 Mar 2016 21:07:27 +0000 (23:07 +0200)
NotImplementedError instead of ImportError.

Lib/pathlib.py
Lib/test/test_pathlib.py
Misc/NEWS

index 5169ff5e633516a3faf69debc8acaecd02635234..ed31ddb8dd8c2dc19152d78a7b26a018f7d89fe7 100644 (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")
index b03fee018f3c97c029d2c7d5e1ffbd11202dfaa9..8ba9c8f3a7951fbbfeb8759133e524c2f739d36a 100644 (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
index b9641816efdea07b4445423d4b08bd50cd6ad2fb..3d9a78735cc65bd35683ea9b3ee784cecf460c0d 100644 (file)
--- 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.