[Python-checkins] cpython (3.5): Issue #20589: Invoking Path.owner() and Path.group() on Windows now raise
berker.peksag
python-checkins at python.org
Fri Mar 11 16:07:38 EST 2016
https://hg.python.org/cpython/rev/8ac695499fa3
changeset: 100489:8ac695499fa3
branch: 3.5
parent: 100487:7474695874d9
user: Berker Peksag <berker.peksag at gmail.com>
date: Fri Mar 11 23:07:27 2016 +0200
summary:
Issue #20589: Invoking Path.owner() and Path.group() on Windows now raise
NotImplementedError instead of ImportError.
files:
Lib/pathlib.py | 6 ++++++
Lib/test/test_pathlib.py | 9 +++++++++
Misc/NEWS | 3 +++
3 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/Lib/pathlib.py b/Lib/pathlib.py
--- a/Lib/pathlib.py
+++ b/Lib/pathlib.py
@@ -1425,3 +1425,9 @@
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
--- a/Lib/test/test_pathlib.py
+++ b/Lib/test/test_pathlib.py
@@ -1156,6 +1156,15 @@
# 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
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -91,6 +91,9 @@
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.
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list