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:
Raymond Hettinger 2011-01-26 20:34:14 +00:00
parent e3b8f7c0fa
commit a63a312a3f
4 changed files with 23 additions and 14 deletions

View file

@ -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: