Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add comments for _ARCHIVE_FORMATS and _UNPACK_FORMATS.
  • Loading branch information
serhiy-storchaka committed May 24, 2022
commit 21cd33d4917456cf53b315ba6651d8c6970bc6a6
10 changes: 10 additions & 0 deletions Lib/shutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,11 @@ def _make_zipfile(base_name, base_dir, verbose=0, dry_run=0,
zip_filename = os.path.abspath(zip_filename)
return zip_filename

# Maps the name of the archive format to a tuple containing:
# * the archiving function
# * extra keyword arguments
# * description
# * does it support the root_dir argument?
_ARCHIVE_FORMATS = {
Comment thread
merwok marked this conversation as resolved.
'tar': (_make_tarball, [('compress', None)],
"uncompressed tar file", True),
Expand Down Expand Up @@ -1238,6 +1243,11 @@ def _unpack_tarfile(filename, extract_dir):
finally:
tarobj.close()

# Maps the name of the archive format to a tuple containing:
Comment thread
serhiy-storchaka marked this conversation as resolved.
Outdated
# * extensions
# * the unpacking function
# * extra keyword arguments
# * description
_UNPACK_FORMATS = {
'tar': (['.tar'], _unpack_tarfile, [], "uncompressed tar file"),
'zip': (['.zip'], _unpack_zipfile, [], "ZIP file"),
Expand Down