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.

Author vstinner
Recipients Ankur.Ankan, berker.peksag, brandon-rhodes, eric.araujo, ezio.melotti, kyle, lars.gustaebel, rhettinger, serhiy.storchaka, vstinner
Date 2013-03-08.02:26:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
+    parser.add_argument('--gz', '--gunzip', '--gzip', '--tgz', '-z', 
+                        '--ungzip', action = 'store_true', 
+                        help = 'gz compression')
+    parser.add_argument('--bz2', '--bzip2', '--tbz2', '--tbz', '--tb2',
+                        action = 'store_true', help = 'bz2 compression')
+    parser.add_argument('--xz', '--lzma', action = 'store_true',
+                        help = 'xz compression')

Do we really need so much names for the same option? Where do these names come from?


main() should exit after extract and create to only do one operation and don't always display the usage.

It would be better to not duplicate the list of options and use parser.print_help() instead of sys.stdout.write(__doc__).

Some consistency tests on exclusive options (bzip/gzip/lzma and list/create/extract) would be nice.


tar options on Linux:

       -c, --create
       -t, --list
       -x, --extract, --get
       -z, --gzip, --ungzip
       -j, -I, --bzip
       -C, --directory DIRECTORY

For tarfile, I propose to have a shorter list, and try to stay somehow compatible with tar:

       -c, --create
       -t, --list
       -x, --extract
       -z, --gzip
       -j, --bzip
       -C, --directory DIRECTORY

Users of the TAR format usually come from UNIX, so using the same command line options should not be so surprising.

I don't like the idea of an optional argument for --extract: "--extract file1 file2" is usually understood/read as "--extract=filename archive.tar". If you really think that we need to support "only extract some files", it should be a different option. Linux tar command has no such option. I propose to drop this feature (always extract all files).
Date User Action Args
2013-03-08 02:26:56vstinnersetrecipients: + vstinner, rhettinger, lars.gustaebel, ezio.melotti, eric.araujo, kyle, brandon-rhodes, berker.peksag, serhiy.storchaka, Ankur.Ankan
2013-03-08 02:26:56vstinnersetmessageid: <>
2013-03-08 02:26:56vstinnerlinkissue13477 messages
2013-03-08 02:26:55vstinnercreate