[Python-Dev] Import redesign [LONG]

James C. Ahlstrom jim@interet.com
Fri, 03 Dec 1999 09:44:54 -0500


Jean-Claude Wippler wrote:
> 
> Guido van Rossum wrote:
> 
> [...]
> > Note that the interpretation of __file__ could be problematic.  To
> > what value do you set __file__ for a module loaded from a zip archive?
> 
> Makefiles use "archive(entry)" (this also supports nesting if needed).

I discovered the hard way this entry is not optional.  I just
used the archive file name for __file__.

> This may be off-topic, but has anyone considered what it would take to
> load shared libs out of an archive?  One way is to extract on-the-fly to
> a temporary area.  A refinement is to leave extracted files there as
> cache, and perhaps even to extract to a file with a name derived from
> its MD5 digest (this way multiple users and even Python installations
> can share the cache).  Would it be useful to define a "standard" area?

IMHO putting shared libs in an archive is a bad idea because the OS
can not use them there.  They must be extracted as you say.  But then
storage is wasted by using space in the archive and the external file.
Deleting them after use wastes time.  Better to leave them out of the
archive and provide for them in the installer.  IMHO the
archive is a basic simple feature, and people make installers on top
of that.  Archives shouldn't try to do it all.

JimA