mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-05 04:47:14 +02:00
30 lines
1.2 KiB
Diff
30 lines
1.2 KiB
Diff
The internal API _decodeExtra() from zipfile has changed since the latest
|
|
release of zipefile2 from 8 years ago. This adapts for the changes.
|
|
--- a/zipfile2/_lean_zipfile.py 2016-03-22 21:38:07.000000000 +0100
|
|
+++ b/zipfile2/_lean_zipfile.py 2024-07-04 12:27:12.459182174 +0200
|
|
@@ -2,6 +2,7 @@ from __future__ import absolute_import
|
|
|
|
import struct
|
|
import sys
|
|
+from binascii import crc32
|
|
|
|
from .common import PY2, BytesIO, string_types
|
|
|
|
@@ -165,6 +166,8 @@ class LeanZipFile(object):
|
|
raise BadZipFile("Bad magic number for central directory")
|
|
filename = fp.read(centdir[_CD_FILENAME_LENGTH])
|
|
flags = centdir[5]
|
|
+
|
|
+ filename_crc = crc32(filename)
|
|
if flags & _UTF8_EXTENSION_FLAG:
|
|
# UTF-8 file names extension
|
|
filename = filename.decode('utf-8')
|
|
@@ -188,7 +191,7 @@ class LeanZipFile(object):
|
|
x.date_time = ((d >> 9) + 1980, (d >> 5) & 0xF, d & 0x1F,
|
|
t >> 11, (t >> 5) & 0x3F, (t & 0x1F) * 2)
|
|
|
|
- x._decodeExtra()
|
|
+ x._decodeExtra(filename_crc)
|
|
x.header_offset = x.header_offset + concat
|
|
|
|
# update total bytes read from central directory
|