[Python-Dev] zipimport, round 3 (or would that be that 37?)
Wiktor Sadowski
Wiktor Sadowski" <art@wiktorsadowski.com
Sun, 8 Dec 2002 19:46:50 +0100
This is a multi-part message in MIME format.
------=_NextPart_000_005D_01C29EF2.8D2854A0
Content-Type: text/plain;
charset="windows-1250"
Content-Transfer-Encoding: quoted-printable
Just van Rossum <just@letterror.com> writes:
> I'll write a bit about the mechanics tomorrow, but in the meantime I =
would like
> to see some test results/bug reports/bug fixes from Windows =
developers. Please
> don't start with the full monty (ie. the std lib), try a small test =
archive
> first please ;-)
I have managed to apply the patch (import.c) to Python2.2.2 (wasn't too =
hard)
Could you please email me the site.py patch,or post it again?=20
>>>base64.decodestring(site.patch)
>>>binascii.Error: Incorrect padding
Python 2.2.2 (#37, Dec 7 2002, 19:19:43) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> import sys
>>> print sys.import_hooks
[<type 'zipimport.zipimporter'>]
>>> from PIL import Image
Traceback (most recent call last):
File "<pyshell#2>", line 1, in ?
from PIL import Image
ImportError: No module named PIL
>>> sys.path.append('C:\Python22\PIL.zip')
>>> from PIL import Image
now it works
>>> from zipimport import zipimporter
>>> arc=3Dzipimporter('C:\Python22\Modules.zip') #Modules.zip - zipped =
non-package directory
>>> m=3Darc.load_module('module1')
ok
>>> arc1=3Dzipimporter('C:\Python22\Modules.zip\Folder1')
>>> m=3Darc1.load_module('fmodule1')
ok
Regards
Wiktor
art@wiktorsadowski.com
------=_NextPart_000_005D_01C29EF2.8D2854A0
Content-Type: text/html;
charset="windows-1250"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1250">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>Just van Rossum <<A=20
href=3D"mailto:just@letterror.com">just@letterror.com</A>> =
writes:</DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV>> I'll write a bit about the mechanics tomorrow, but in the =
meantime I=20
would like<BR>> to see some test results/bug reports/bug fixes from =
Windows=20
developers. Please<BR>> don't start with the full monty (ie. the std =
lib),=20
try a small test archive<BR>> first please ;-)</DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV>I have managed to apply the patch (import.c) to Python2.2.2 =
(wasn't=20
too hard)</DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV>Could you please email me the site.py patch,or post it again?=20
<BR>>>>base64.decodestring(site.patch)<BR>>>>binascii.E=
rror:=20
Incorrect padding</DIV>
<DIV> </DIV>
<DIV>Python 2.2.2 (#37, Dec 7 2002, 19:19:43) [MSC 32 bit (Intel)] =
on=20
win32<BR>Type "copyright", "credits" or "license" for more=20
information.<BR><BR>>>> import sys<BR>>>> print=20
sys.import_hooks<BR>[<type 'zipimport.zipimporter'>]</DIV>
<DIV> </DIV>
<DIV>>>> from PIL import Image<BR>Traceback (most recent call=20
last):<BR> File "<pyshell#2>", line 1, in =
?<BR> =20
from PIL import Image<BR>ImportError: No module named PIL</DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV>>>> sys.path.append('C:\Python22\PIL.zip')<BR>>>> =
from=20
PIL import Image<BR>now it works</DIV>
<DIV> </DIV>
<DIV>>>> from zipimport import zipimporter<BR>>>>=20
arc=3Dzipimporter('C:\Python22\Modules.zip') #Modules.zip - zipped =
non-package directory<BR>>>> =
m=3Darc.load_module('module1')<BR>ok</DIV>
<DIV> </DIV>
<DIV>>>>=20
arc1=3Dzipimporter('C:\Python22\Modules.zip\Folder1')<BR>>>>=20
m=3Darc1.load_module('fmodule1')<BR>ok</DIV>
<DIV> </DIV>
<DIV><BR>Regards<BR>Wiktor<BR><A=20
href=3D"mailto:art@wiktorsadowski.com">art@wiktorsadowski.com</A><BR></DI=
V></BODY></HTML>
------=_NextPart_000_005D_01C29EF2.8D2854A0--