msg155854 - (view) |
Author: Sergey Dorofeev (fidoman) |
Date: 2012-03-15 04:35 |
unzip does extract files but zipfile no
works fine with python2.7 but fails with python 3.2.2
tested on solaris 11 express and windows xp
>>> import zipfile
>>> zipfile.ZipFile("test.zip")
<zipfile.ZipFile object at 0x903e50>
>>> z=_
>>> z.namelist
<bound method ZipFile.namelist of <zipfile.ZipFile object at 0x903e50>>
>>> z.namelist()
['19A7B5A4.PKT']
>>> z.read('19A7B5A4.PKT')
b''
|
msg155872 - (view) |
Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * |
Date: 2012-03-15 08:57 |
This ZIP file uses a compression method unsupported by Python:
>>> z.getinfo('19A7B5A4.PKT').compress_type
6
which corresponds to "Imploded". Only "Stored" and "Deflated" are supported.
Note that previous versions don't work either: they just happen to return the compressed data.
|
msg156065 - (view) |
Author: Glenn Linderman (v+python) * |
Date: 2012-03-16 18:13 |
While Amaury's comment is no doubt true, shouldn't z.read raise an exception if it encounters an unsupported compression type?
|
msg156101 - (view) |
Author: Éric Araujo (eric.araujo) * |
Date: 2012-03-16 23:20 |
The requested change is arguably a new feature, but it seems to me that the current behavior is not acceptable and should be changed.
|
msg160628 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) * |
Date: 2012-05-14 15:31 |
Modified patch adopted in 3.3 (changeset 596b0eaeece8), therefore the current patch only applies to 3.2 and 2.7. If this is a new feature, the issue can be closed.
|
msg160660 - (view) |
Author: Martin v. Löwis (loewis) * |
Date: 2012-05-14 20:17 |
Returning the compressed data from read() is clearly a bug (IMO), so detecting that and reporting an exception would be a bug fix.
I still like NotImplementedError more than RuntimeError, though.
|
msg160926 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) * |
Date: 2012-05-16 20:15 |
> I still like NotImplementedError more than RuntimeError, though.
Well. here are patches for Python 3.2 and 2.7 (backported changeset
596b0eaeece8 + part of changeset fccdcd83708a).
|
msg172545 - (view) |
Author: Stephen McInerney (spmcinerney) |
Date: 2012-10-10 00:38 |
The patch is great, can you approve it urgently please?
It is seriously buggy to silently return a bad filestream, and not just throw the exception. I just wasted over a day's productivity due to this. I'm not alone.
I would argue for raising priority to High. This is a bad bug with a simple but urgent fix.
|
msg172591 - (view) |
Author: Éric Araujo (eric.araujo) * |
Date: 2012-10-10 16:18 |
Raising priority won’t give more free time to the module maintainer, or change the planned date for the next release. Thanks for reviewing the patch however, it is helpful. Did you apply it and run the test suite?
|
msg172601 - (view) |
Author: Stephen McInerney (spmcinerney) |
Date: 2012-10-10 20:27 |
I visually reviewed the patch, it's fine by me. (Am not set up to compile it.)
When is 2.7.3.x release planned?
|
msg174477 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) * |
Date: 2012-11-01 21:21 |
Éric, this changes already in 3.3 (changeset 596b0eaeece8 + part of changeset fccdcd83708a). This two patches only backport the fix to 2.7 and 3.2.
|
msg175865 - (view) |
Author: Roundup Robot (python-dev) |
Date: 2012-11-18 11:23 |
New changeset 8feaa8d04c56 by Ezio Melotti in branch '2.7':
#14313: zipfile now raises NotImplementedError when the compression type is unknown.
http://hg.python.org/cpython/rev/8feaa8d04c56
New changeset b193a5dc7a58 by Ezio Melotti in branch '3.2':
#14313: zipfile now raises NotImplementedError when the compression type is unknown.
http://hg.python.org/cpython/rev/b193a5dc7a58
New changeset c2ba10b9d654 by Ezio Melotti in branch '3.3':
#14313: null merge.
http://hg.python.org/cpython/rev/c2ba10b9d654
New changeset 4b866e39d1fb by Ezio Melotti in branch 'default':
#14313: null merge.
http://hg.python.org/cpython/rev/4b866e39d1fb
|
msg175866 - (view) |
Author: Ezio Melotti (ezio.melotti) * |
Date: 2012-11-18 11:24 |
Fixed, thanks for the patches!
|
|
Date |
User |
Action |
Args |
2022-04-11 14:57:28 | admin | set | github: 58521 |
2012-12-03 15:57:12 | serhiy.storchaka | link | issue5701 superseder |
2012-11-18 11:24:34 | ezio.melotti | set | status: open -> closed
assignee: ezio.melotti
nosy:
+ ezio.melotti messages:
+ msg175866 resolution: fixed stage: patch review -> resolved |
2012-11-18 11:23:09 | python-dev | set | nosy:
+ python-dev messages:
+ msg175865
|
2012-11-01 21:21:23 | serhiy.storchaka | set | messages:
+ msg174477 versions:
- Python 3.3, Python 3.4 |
2012-11-01 21:17:23 | serhiy.storchaka | set | files:
- zipfile_unsupported_compression.patch |
2012-10-10 20:27:10 | spmcinerney | set | messages:
+ msg172601 |
2012-10-10 16:18:58 | eric.araujo | set | messages:
+ msg172591 versions:
+ Python 3.3, Python 3.4 |
2012-10-10 00:38:10 | spmcinerney | set | nosy:
+ spmcinerney messages:
+ msg172545
|
2012-05-16 20:15:55 | serhiy.storchaka | set | files:
+ zipfile_unsupported_compression-3.2.patch, zipfile_unsupported_compression-2.7.patch
messages:
+ msg160926 |
2012-05-14 20:17:27 | loewis | set | messages:
+ msg160660 |
2012-05-14 15:31:48 | serhiy.storchaka | set | nosy:
+ loewis, serhiy.storchaka
messages:
+ msg160628 versions:
- Python 3.3 |
2012-05-14 13:45:03 | eric.araujo | set | keywords:
+ needs review stage: patch review |
2012-04-29 13:17:56 | serhiy.storchaka | set | files:
+ zipfile_unsupported_compression.patch keywords:
+ patch |
2012-03-16 23:20:22 | eric.araujo | set | title: zipfile does not unpack files from archive (files extracted have zero length) -> zipfile should raise an exception for unsupported compression methods messages:
+ msg156101 versions:
+ Python 2.7, Python 3.3 |
2012-03-16 23:18:24 | eric.araujo | set | nosy:
+ alanmcintyre, eric.araujo
stage: needs patch -> (no value) |
2012-03-16 18:13:51 | v+python | set | nosy:
+ v+python messages:
+ msg156065
|
2012-03-15 08:57:54 | amaury.forgeotdarc | set | nosy:
+ amaury.forgeotdarc
messages:
+ msg155872 stage: needs patch |
2012-03-15 04:35:35 | fidoman | create | |