[New-bugs-announce] [issue11548] Passing format= to unpack_archive fails

Evan Dandrea report at bugs.python.org
Tue Mar 15 04:30:26 CET 2011

New submission from Evan Dandrea <ev at ubuntu.com>:

Passing the format keyword parameter to shutil.unpack_archive triggers an exception:

Traceback (most recent call last):
  File "Lib/test/test_shutil.py", line 650, in test_unpack_archive
    unpack_archive(filename, tmpdir2, format=format)
  File "/home/evan/hg/cpython/Lib/shutil.py", line 741, in unpack_archive
    func(filename, extract_dir, **dict(format_info[1]))
TypeError: 'function' object is not iterable

This is due to that function incorrectly using the _UNPACK_FORMATS dictionary, which is fixed with the attached patch and test case.

components: Library (Lib)
files: fix_unpack_with_format.patch
keywords: patch
messages: 130948
nosy: ev, tarek
priority: normal
severity: normal
status: open
title: Passing format= to unpack_archive fails
type: crash
Added file: http://bugs.python.org/file21196/fix_unpack_with_format.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list