This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2014年06月13日 18:29 by dstufft, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Messages (12) | |||
|---|---|---|---|
| msg220477 - (view) | Author: Donald Stufft (dstufft) * (Python committer) | Date: 2014年06月13日 18:29 | |
Since Python 3.3 the zipfile module has support bzip2 and lzma compression, however the zipimporter does not support these. It would be awesome if zipimport did support them. |
|||
| msg220481 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2014年06月13日 19:02 | |
See also issue 17004 and issue 5950. |
|||
| msg220518 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2014年06月14日 01:18 | |
Zipimporter doesn't use zipfile (the former is written in C), so it unfortunately doesn't fall through for support. |
|||
| msg220527 - (view) | Author: Donald Stufft (dstufft) * (Python committer) | Date: 2014年06月14日 02:39 | |
Right, but it could still have support for those things implemented yea? |
|||
| msg220528 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2014年06月14日 02:48 | |
On Jun 13, 2014 7:39 PM, "Donald Stufft" <report@bugs.python.org> wrote: > > > Donald Stufft added the comment: > > Right, but it could still have support for those things implemented yea? Yes, it's just zipimport has a history of being difficult to maintain. > > ---------- > > _______________________________________ > Python tracker <report@bugs.python.org> > <http://bugs.python.org/issue21751> > _______________________________________ |
|||
| msg220538 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2014年06月14日 08:56 | |
As shown in msg180323, using lzma compression for typical *.py and *.pyc produces 8% less zip file, but reading from it is 2.5 times slower. The bzip2 compression is even worse. So there is no large benefit in supporting other compression methods. |
|||
| msg220569 - (view) | Author: Donald Stufft (dstufft) * (Python committer) | Date: 2014年06月14日 17:12 | |
I disagree that there is no large benefit. Python files aren't the only files that could exist inside of a zip file. Supporting LZMA import (or bz2) would make it easier to have LZMA or bzip2 wheels in the future without losing the ability to import them. |
|||
| msg220572 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2014年06月14日 17:42 | |
For non-Python files you don't need support of bzip2 or lzma compression in zipimport. Use zipfile which supports advanced compression. |
|||
| msg220573 - (view) | Author: Donald Stufft (dstufft) * (Python committer) | Date: 2014年06月14日 17:46 | |
I'm not sure what that statement means. There is package data that sits alongside python files. These cannot use anything but DEFLATED because zipimport doesn't support it. |
|||
| msg220590 - (view) | Author: Eric Snow (eric.snow) * (Python committer) | Date: 2014年06月14日 22:20 | |
related: issue #17630 |
|||
| msg220599 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2014年06月15日 00:06 | |
Another use case is more aggressively shrinking the bundled copy of pip. We don't really care about speed of execution there (since we only run it directly once at install time to do the bootstrapping), but we do care about the impact on the installer size. However, that's a fairly specialised case - for wheel 2.0 in general, we can consider dropping the "always usable as a sys.path entry" behaviour and not need to worry about the constraints of zipimport (which has indeed exhibited unfortunate "we touch it, we break it" behaviour in recent releases, due to the vagaries of zip implementations on various platforms). A more general archive importer written in Python could also be useful - there's no requirement that all archive formats be handled by the existing meta importer. Putting such an importer *after* the existing zip importer in the metapath would minimise any risk of backwards incompatibility issues, and allow it to initially be created as a third party module on PyPI. |
|||
| msg220617 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2014年06月15日 07:41 | |
You can use deflate for Python files and advanced compression methods for large well-compressable package data. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:04 | admin | set | github: 65950 |
| 2014年06月15日 07:41:20 | serhiy.storchaka | set | messages: + msg220617 |
| 2014年06月15日 00:06:42 | ncoghlan | set | messages: + msg220599 |
| 2014年06月14日 22:20:32 | eric.snow | set | messages: + msg220590 |
| 2014年06月14日 17:46:07 | dstufft | set | messages: + msg220573 |
| 2014年06月14日 17:42:02 | serhiy.storchaka | set | messages: + msg220572 |
| 2014年06月14日 17:12:28 | dstufft | set | messages: + msg220569 |
| 2014年06月14日 08:56:02 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka messages: + msg220538 |
| 2014年06月14日 08:47:51 | serhiy.storchaka | set | status: open -> closed superseder: Expand zipimport to include other compression methods resolution: duplicate |
| 2014年06月14日 02:48:00 | brett.cannon | set | messages: + msg220528 |
| 2014年06月14日 02:39:31 | dstufft | set | messages: + msg220527 |
| 2014年06月14日 01:18:46 | brett.cannon | set | messages: + msg220518 |
| 2014年06月13日 19:02:09 | r.david.murray | set | nosy:
+ r.david.murray messages: + msg220481 |
| 2014年06月13日 18:29:15 | dstufft | create | |