py2exe and urllib(2) errors

Mike Zupan mike at zcentric.com
Mon Mar 15 11:44:55 EST 2004


I had some problems with urllib and py2exe under pyton2.3. I works fine
until i try to use the exe file.

Here is the error

Error: 1
LookupError Exception in Tk callback
  Function: <bound method MainWindow.selectDir of <__main__.MainWindow
instance
at 0x00DF4058>> (type: <type 'instancemethod'>)
  Args: ()
Traceback (innermost last):
  File "Pmw.pyc", line 1784, in __call__
    None
  File "<string>", line 270, in selectDir
    None
  File "<string>", line 361, in grabAlbumDirs
    None
  File "<string>", line 431, in addAlbumData
    None
  File "<string>", line 469, in grabImage
    None
  File "urllib2.pyc", line 129, in urlopen
    None
  File "urllib2.pyc", line 326, in open
    None
  File "urllib2.pyc", line 306, in _call_chain
    None
  File "urllib2.pyc", line 901, in http_open
    None
  File "urllib2.pyc", line 884, in do_open
    None
  File "httplib.pyc", line 712, in endheaders
    None
  File "httplib.pyc", line 597, in _send_output
    None
  File "httplib.pyc", line 564, in send
    None
  File "httplib.pyc", line 532, in connect
    None
LookupError: no codec search functions registered: can't find encoding


Here is the section of code that produces the error

urllib.urlretrieve(imageURL, saveFile)

imageURL and saveFile are correct


Here is my setup.py file

# setup.py
from distutils.core import setup

import py2exe

setup(
    scripts=["art.py"]
)


and here is my batch file

c:\python23\python setup.py py2exe -pPIL --packages=encodings


Thanks
Mike






More information about the Python-list mailing list