Python3: ZipFile instance has no attribute 'extractall'
Question: 
    from zipfile import ZipFile
    
    
    fzip=ZipFile("crackme.zip")
    fzip.extractall(pwd=b"mysecretpassword")
    

the script works only on IDLE, but when i run it from the command line, it
displays:

> unzip.py

fzip.extractall(pwd=b"mysecretpassword")

    
    
                                  ^
    

SyntaxError: invalid syntax

what's wrong?


Answer: It works (Ubuntu 13.04):

    
    
    >>> import sys
    >>> sys.version
    '3.3.1 (default, Apr 17 2013, 22:32:14) \n[GCC 4.7.3]'
    
    >>> from zipfile import ZipFile
    >>> f = ZipFile('a.zip')
    

BTW, `pwd` should be bytes objects:

    
    
    >>> f.extractall(pwd="mysecretpassword")
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python3.3/zipfile.py", line 1225, in extractall
        self.extract(zipinfo, path, pwd)
      File "/usr/lib/python3.3/zipfile.py", line 1213, in extract
        return self._extract_member(member, path, pwd)
      File "/usr/lib/python3.3/zipfile.py", line 1275, in _extract_member
        with self.open(member, pwd=pwd) as source, \
      File "/usr/lib/python3.3/zipfile.py", line 1114, in open
        raise TypeError("pwd: expected bytes, got %s" % type(pwd))
    TypeError: pwd: expected bytes, got <class 'str'>
    >>> f.extractall(pwd=b'mysecretpassword')
    >>>
    

According to [`zipfile.ZipFile.extractall`
documentation](http://docs.python.org/3/library/zipfile.html#zipfile.ZipFile.extractall):

> **Warning** Never extract archives from untrusted sources without prior
> inspection. It is possible that files are created outside of path, e.g.
> members that have absolute filenames starting with "/" or filenames with two
> dots "..".
>
> _Changed in version 3.3.1_ : The zipfile module attempts to prevent that.
> See `extract()` note.

