Il giorno 10/ott/2011, alle ore 11:49, Hartmut Goebel ha scritto:
> Hi,
>
> I just stepped over hook-xml crashing with 'bad marshal data', because
> site-packages/_xmlplus/__init__.py is read instead of .pyc.
>
> IMHO the text for the filename is plain wrong.
>
> Can anybody please verify this patch is correct:
>
> ===================================================================
> --- PyInstaller/hooks/hook-xml.py (Revision 1649)
> +++ PyInstaller/hooks/hook-xml.py (Arbeitskopie)
> @@ -27,7 +27,7 @@
> txt = exec_statement("import xml;print xml.__file__")
>
> if txt.find('_xmlplus') > -1:
> - if txt[:-3] == ".py":
> + if txt.endswith(".py"):
> txt = txt + 'c'
> co = marshal.loads(open(txt, 'rb').read()[8:])
> old_pth = mod.__path__[:]I can't verify, but I wrote that code (IIRC) and your patch is obvious enough. I would go ahead and apply it (and backport it to the active release branch). -- Giovanni Bajo :: [email protected] Develer S.r.l. :: http://www.develer.com My Blog: http://giovanni.bajo.it
smime.p7s
Description: S/MIME cryptographic signature
