Make sure archive arguments are checked.
This commit is contained in:
parent
d0150139fb
commit
78cbd6b1b1
|
@ -480,7 +480,6 @@ def _handle_archive (archive, command, *args, **kwargs):
|
||||||
"""Handle archive command; raising PatoolError on errors.
|
"""Handle archive command; raising PatoolError on errors.
|
||||||
@return: output directory if command is 'extract', else None
|
@return: output directory if command is 'extract', else None
|
||||||
"""
|
"""
|
||||||
check_archive_arguments(archive, command, *args)
|
|
||||||
format, compression = kwargs.get("format"), kwargs.get("compression")
|
format, compression = kwargs.get("format"), kwargs.get("compression")
|
||||||
if format is None:
|
if format is None:
|
||||||
format, compression = get_archive_format(archive)
|
format, compression = get_archive_format(archive)
|
||||||
|
@ -614,11 +613,12 @@ def _repack_archive (archive1, archive2, **kwargs):
|
||||||
|
|
||||||
def handle_archive (archive, command, *args, **kwargs):
|
def handle_archive (archive, command, *args, **kwargs):
|
||||||
"""Handle archive file command; with nice error reporting."""
|
"""Handle archive file command; with nice error reporting."""
|
||||||
|
check_archive_arguments(archive, command, *args)
|
||||||
try:
|
try:
|
||||||
if command == "diff":
|
if command == "diff":
|
||||||
res = _diff_archives(archive, args[0])
|
res = _diff_archives(archive, args[0], **kwargs)
|
||||||
elif command == "repack":
|
elif command == "repack":
|
||||||
res = _repack_archive(archive, args[0])
|
res = _repack_archive(archive, args[0], **kwargs)
|
||||||
else:
|
else:
|
||||||
_handle_archive(archive, command, *args, **kwargs)
|
_handle_archive(archive, command, *args, **kwargs)
|
||||||
res = 0
|
res = 0
|
||||||
|
|
Loading…
Reference in New Issue