New submission from Andreas Hilboll: shutil.make_archive should be able to automatically determine the desired *format* from the given filename. It would make life easier, because the programmer wouldn't need to strip the extension from the filename before passing it to make_archive. I'm think of something along the lines of
if base_path.lower().endswith(".zip"): fmt = "zip" base_path = base_path[:-4] elif base_path.lower().endswith(".tar.gz") or base_path.lower().endswith(".tgz"): fmt = "gztar" base_path = base_path[:-7] elif base_path.lower().endswith(".tar.bz2"): fmt = "bztar" base_path = base_path[:-8] elif base_path.lower().endswith(".tar"): fmt = "tar" base_path = base_path[:-4] ---------- messages: 199373 nosy: andreas-h priority: normal severity: normal status: open title: shutil.make_archive should recognize extensions in filenames type: enhancement versions: Python 2.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19214> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com