def unzip(file):
    """
    Take a path to a zipfile and checks if it is a valid zip file
    and returns...
    """
    files = []
    # TODO: implement try-except here
    zip = zipfile.ZipFile(file)
    bad_file = zip.testzip()
    if bad_file:
        raise Exception('"%s" in the .zip archive is corrupt.' % bad_file)
    infolist = zip.infolist()
    print infolist
    for zipinfo in infolist:
        print zipinfo.filename % "handling %s"
        if zipinfo.filename.startswith('__'): # do not process meta files
            continue
        thefile = SimpleUploadedFile(name=zipinfo.filename, content=zip.read(zipinfo))
        files.append( (thefile, zipinfo.filename) )
    zip.close()
    return files
dataset/ETHPy150Open stefanfoulis/django-image-filer/image_filer/utils/zip.py/unzip/swapped operands of `%`