bpo-30218: support path-like objects in shutil.unpack_archive() (GH-1367)

Thanks to Jelle Zijlstra for the patch.
This commit is contained in:
Jelle Zijlstra 2017-05-05 14:27:12 -07:00 committed by Brett Cannon
parent a1054c3b00
commit a12df7b7d4
4 changed files with 26 additions and 4 deletions

View file

@ -958,6 +958,9 @@ def unpack_archive(filename, extract_dir=None, format=None):
if extract_dir is None:
extract_dir = os.getcwd()
extract_dir = os.fspath(extract_dir)
filename = os.fspath(filename)
if format is not None:
try:
format_info = _UNPACK_FORMATS[format]