diff options
author | Raymond Hettinger <python@rcn.com> | 2011-01-26 20:34:14 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2011-01-26 20:34:14 (GMT) |
commit | a63a312a3f5a4f3b76617831e56ac9d295929fa0 (patch) | |
tree | 18504231f06733d800b5417cd6e0c4c0de6e8966 /Lib/test/test_tarfile.py | |
parent | e3b8f7c0fa47bbf7c31a2912789e1618e129b539 (diff) | |
download | cpython-a63a312a3f5a4f3b76617831e56ac9d295929fa0.zip cpython-a63a312a3f5a4f3b76617831e56ac9d295929fa0.tar.gz cpython-a63a312a3f5a4f3b76617831e56ac9d295929fa0.tar.bz2 |
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.)
Diffstat (limited to 'Lib/test/test_tarfile.py')
-rw-r--r-- | Lib/test/test_tarfile.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index ff02c69..94ef61c 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -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: |