From 3db848efa3e399e773cbb49c0f5663c04cdbc6c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0smail=20D=C3=B6nmez?= Date: Mon, 31 Dec 2007 22:01:54 +0000 Subject: [PATCH] don't apply the change --- pisi/archive.py | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/pisi/archive.py b/pisi/archive.py index 574228d3..a0b5db48 100644 --- a/pisi/archive.py +++ b/pisi/archive.py @@ -19,7 +19,6 @@ import shutil import tarfile import zipfile import gzip -import struct import gettext __trans = gettext.translation('pisi', fallback=True) @@ -213,23 +212,7 @@ class MyZipFile(zipfile.ZipFile): "Attempt to read ZIP archive that was already closed" zinfo = self.getinfo(name) filepos = self.fp.tell() - - self.fp.seek(zinfo.header_offset, 0) - - # Skip the file header: - fheader = self.fp.read(30) - if fheader[0:4] != zipfile.stringFileHeader: - raise BadZipfile, "Bad magic number for file header" - - fheader = struct.unpack(zipfile.structFileHeader, fheader) - fname = self.fp.read(fheader[zipfile._FH_FILENAME_LENGTH]) - if fheader[zipfile._FH_EXTRA_FIELD_LENGTH]: - self.fp.read(fheader[zipfile._FH_EXTRA_FIELD_LENGTH]) - - if fname != zinfo.orig_filename: - raise zipfile.BadZipfile, \ - 'File name in directory "%s" and header "%s" differ.' % ( - zinfo.orig_filename, fname) + self.fp.seek(zinfo.file_offset, 0) destfile = file(outname, 'wb')