This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: 'filter' argument for Tarfile.add needs to be a keyword-only argument
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: antlong, brian.curtin, georg.brandl, rhettinger
Priority: high Keywords: patch

Created on 2011-01-26 02:27 by rhettinger, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
tarfile.patch rhettinger, 2011-01-26 02:27 Patch for tarfile and its docs.
tarfile.patch2 rhettinger, 2011-01-26 20:00 Second patch adds a test
Messages (7)
msg127083 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2011-01-26 02:27
In 3.2, tarfile.Tarfile added a 'filter' argument while deprecating the 'exclude' argument that precedes it positionally.

The 'filter' argument needs to be keyword-only argument, or any code that uses it positionally will fail when the 'exclude' argument is ultimately removed.
msg127091 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2011-01-26 06:00
Also note the 'filter' argument to the add() method is also in Py2.7 though it doesn't have the same issue of the preceding argument being deprecated.  For 2.7, I recommend adding a note to the docs and docstring to not use the 'filter' argument positionally; otherwise, there will be a minor 2-to-3 issue.
msg127131 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2011-01-26 20:05
Looks good to me.

As discussed in IRC, a note in 2.7 about the future of the `add` signature would also be helpful.
msg127132 - (view) Author: Anthony Long (antlong) Date: 2011-01-26 20:08
Tests trying all positions and expecting an appropriate TypeError should be included.
msg127133 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2011-01-26 20:10
Anthony, that is what tarfile.patch2 does.
msg127134 - (view) Author: Anthony Long (antlong) Date: 2011-01-26 20:13
Strange, I didn't see it until this email came. Probably an old browser cache.

Either way, looks good to me. No issues on mac SL.
msg127136 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2011-01-26 20:35
Fixed in r88201.

Will add a note to 2.7 docs advising use as a keyword-only argument.
History
Date User Action Args
2022-04-11 14:57:11adminsetgithub: 55223
2011-01-26 20:35:32rhettingersetstatus: open -> closed

messages: + msg127136
resolution: fixed
nosy: georg.brandl, rhettinger, brian.curtin, antlong
2011-01-26 20:13:51antlongsetnosy: + antlong
messages: + msg127134
2011-01-26 20:10:17rhettingersetnosy: georg.brandl, rhettinger, brian.curtin
messages: + msg127133
2011-01-26 20:08:40antlongsetnosy: - antlong
2011-01-26 20:08:23antlongsetnosy: + antlong
messages: + msg127132
2011-01-26 20:05:32brian.curtinsetnosy: + brian.curtin
messages: + msg127131
2011-01-26 20:00:49rhettingersetfiles: + tarfile.patch2
nosy: georg.brandl, rhettinger
2011-01-26 06:00:41rhettingersetnosy: georg.brandl, rhettinger
messages: + msg127091
2011-01-26 02:27:25rhettingercreate