pathlib
-------
+* Remove support for passing additional keyword arguments to
+ :class:`pathlib.Path`. In previous versions, any such arguments are ignored.
* Remove support for passing additional positional arguments to
:meth:`pathlib.PurePath.relative_to` and
:meth:`~pathlib.PurePath.is_relative_to`. In previous versions, any such
def _unsupported_msg(cls, attribute):
return f"{cls.__name__}.{attribute} is unsupported on this system"
- def __init__(self, *args, **kwargs):
- if kwargs:
- msg = ("support for supplying keyword arguments to pathlib.PurePath "
- "is deprecated and scheduled for removal in Python {remove}")
- warnings._deprecated("pathlib.PurePath(**kwargs)", msg, remove=(3, 14))
- super().__init__(*args)
-
def __new__(cls, *args, **kwargs):
if cls is Path:
cls = WindowsPath if os.name == 'nt' else PosixPath
self.assertTrue(R.is_mount())
self.assertFalse((R / '\udfff').is_mount())
- def test_passing_kwargs_deprecated(self):
- with self.assertWarns(DeprecationWarning):
+ def test_passing_kwargs_errors(self):
+ with self.assertRaises(TypeError):
self.cls(foo="bar")
def setUpWalk(self):