Issue1783554

classification
Title: CPython compatible zipimporter
Type: Severity: normal
Components: None Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: pjenvey
Priority: normal Keywords: patch

Created on 2007-08-28.18:05:51 by pjenvey, last changed 2007-08-31.22:21:41 by pjenvey.

Files
File name Uploaded Description Edit Remove
zipimporter_r3455.diff pjenvey, 2007-08-28.18:05:51 patch against trunk r3455
Messages
msg2839 (view) Author: Philip Jenvey (pjenvey) Date: 2007-08-28.18:05:51
This is a full implementation of CPython's zipimporter. It replaces our ZipFileImporter, which actually predates CPython's zipimporter that stemmed from PEP 302

Notes:

o ZipFileImporter was removed. It's possible we could remove SyspathArchive in the future, if we can make SyspathJavaLoader not rely on it (SyspathArchive is pretty lame)

o ZipImportException is initialized during exceptions.classDictInit when built in exceptions are initialized during startup. It has to be initialized as early as possible, but has to be done with a current PyFrame (which exceptions.classDictInit fakes to create its own exceptions)

o zipimporter creates the PyCode, then sets __loader__ and __path__ on its PyModule, then executes the PyCode. This is to match CPython's behavior. ZipFileImporter was lazier about this (resulting in some potential bugs). A couple imp methods were made public/split into two methods from one to support this
msg2840 (view) Author: Philip Jenvey (pjenvey) Date: 2007-08-28.23:48:21
test_zipimport.py needs some work (e.g. it should test loading $py.class instead of .pycs). I haven't fixed it yet because it's relying on the marshal module, which is broken
msg2841 (view) Author: Philip Jenvey (pjenvey) Date: 2007-08-31.22:21:41
applied in r3462-3
History
Date User Action Args
2007-08-28 18:05:51pjenveycreate