Hi Martin, Thanks for taking the time to look at my code. "Martin v. Loewis" wrote: > Section zlib, "will fail with a message": > > Is this still current? Looking at the implementation, it seems that > you'll rather get an import error, which sounds much better. Yes, you are right. If a module is found in a zip file, and the zip module is compressed, and zlib is unavailable, then get_zip_string() fails with PyExc_ValueError (and a message), and the import fails. > Section Booting > > Looking at the implementation, it appears that PyImport_InitZip > already invokes PyImport_ImportModule. Is there a mechanism that > prevents ZIP import from being used while it is not ready yet? At the point that PyImport_ImportModule("os") is called, zip imports are ready. Specifically, python22.zip has been added to sys.path, and zlib has been imported. The attempted import of the "os" module can be satisfied from a zip archive or from a directory. We are attempting to import the os module to support caching of directory contents using os.listdir(). This would cause an infinite loop except for the use of the use_os_listdir flag. This flag is zero if os.listdir has not yet been imported. It is 1 if os.listdir is available, and -1 if it is unavailable. JimA
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4