zipfile cant handle some type of zip data?

前端 未结 3 866
深忆病人
深忆病人 2021-01-02 09:54

I came up over this problem while trying to decompress a zip file.

-- zipfile.is_zipfile(my_file) always returns False, even though the UNIX command unz

3条回答
  •  萌比男神i
    2021-01-02 10:23

    You say using less on the file it shows such and such. Do you mean this?

    less my_file
    

    If so, I would guess these are comments that the zip program put in the file. Looking at a user guide for the iSeries PKZIP I found on the web, this appears to be the default behavior.

    The docs for zipfile say "This module does not currently handle ZIP files which have appended comments." Perhaps this is the problem? (Of course, if less shows them, this would seem to imply that they're prepended, FWIW.)

    It appears you (or whoever created the zipfile on an iSeries machine) can turn this off with ARCHTEXT(*NONE), or use ARCHTEXT(*CLEAR) to remove it from an existing zipfile.

提交回复
热议问题