gh-74033: Fix bug when Path takes and ignores **kwargs (GH-19632)

Fix a bug where `Path` takes and ignores `**kwargs` by adding to `PurePath`  class `__init__` method which can take only positional arguments.

Automerge-Triggered-By: GH:brettcannon
This commit is contained in:
Yurii Karabas 2023-01-14 02:05:43 +02:00 committed by GitHub
parent 1bc7a73683
commit 080cb27829
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 0 deletions

View file

@ -2571,6 +2571,11 @@ class _BasePathTest(object):
def test_complex_symlinks_relative_dot_dot(self):
self._check_complex_symlinks(os.path.join('dirA', '..'))
def test_passing_kwargs_deprecated(self):
with self.assertWarns(DeprecationWarning):
self.cls(foo="bar")
class WalkTests(unittest.TestCase):
def setUp(self):