I've been using pyinstaller successfully for a while but after
upgrading my Linux system from Gutsy to Jaunty, my binary now
produces this error:
...
File "linux2/build/pyi.linux2/vm-sitesurvey/outPYZ1.pyz/mylibrary", line 454, in InvokeMethod
File "linux2/build/pyi.linux2/vm-sitesurvey/outPYZ1.pyz/httplib", line 874, in request
File "linux2/build/pyi.linux2/vm-sitesurvey/outPYZ1.pyz/httplib", line 891, in _send_request
File "linux2/build/pyi.linux2/vm-sitesurvey/outPYZ1.pyz/httplib", line 818, in putrequest
LookupError: unknown encoding: ascii
The script works fine running it directly, only the pyinstaller-
created binary produces the error. As you can see, there's a
python module I'm using (shown as "mylibrary" above) which uses
httplib and httplib is throwing the LookupError.
Things I have tried:
- pulling the latest pyinstaller from svn
- searching this mailing list and the web for this issue
- adding a hook-httplib.py to the hooks directory that contains:
hiddenimports = ['encodings.ascii', 'encodings.utf_8']
But none of these have changed the behavior. Ideas?
Thanks much,
-andy
-andy
#!/usr/bin/python
import httplib
conn = httplib.HTTPConnection('www.google.com')
conn.request('GET', '/')
resp = conn.getresponse()
print resp.read()
Thanks! That's exactly what I needed. I didn't realize PyInstaller
wasn't supporting Python 2.6 yet. To help people in the future who
search for this problem, I'll mention that the Jaunty repository includes
python2.5 so it is pretty easy to give PyInstaller what it is known
to work with:
% sudo apt-get install python2.5 python2.5-dev
(and then use "python2.5" with PyInstaller)
-andy
I have just fixed the specific bug reported on this thread (see commit
[671]). I'm not sure if it fixes all the encoding-related problems
though... would you please check again yours?
--
Giovanni Bajo
Develer S.r.l.
http://www.develer.com