mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-30218: support path-like objects in shutil.unpack_archive() (GH-1367)
Thanks to Jelle Zijlstra for the patch.
This commit is contained in:
parent
a1054c3b00
commit
a12df7b7d4
4 changed files with 26 additions and 4 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue