mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #11014: Make 'filter' argument in tarfile.Tarfile.add() into a
keyword-only argument. The preceding positional argument was deprecated, so it made no sense to add filter as a positional argument. (Patch reviewed by Brian Curtin and Anthony Long.)
This commit is contained in:
parent
e3b8f7c0fa
commit
a63a312a3f
4 changed files with 23 additions and 14 deletions
|
@ -919,6 +919,10 @@ class WriteTest(WriteTestBase):
|
|||
finally:
|
||||
tar.close()
|
||||
|
||||
# Verify that filter is a keyword-only argument
|
||||
with self.assertRaises(TypeError):
|
||||
tar.add(tempdir, "empty_dir", True, None, filter)
|
||||
|
||||
tar = tarfile.open(tmpname, "r")
|
||||
try:
|
||||
for tarinfo in tar:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue