py2exe error

Haim Ashkenazi haim at
Wed Jan 21 15:40:02 CET 2004


(complete newbie warning...:) )

I've written a script that uses pickle to store data to a file. here's the
code that stored the data:


    def put(self, conf):
        """ dump the preferences to a file"""
        # TODO: make a backup copy of the prefs !!!!
            f = open(self.bacFile, "w")
            raise 'BadFileError', "couldn't write file"
        pickle.dump(conf, f)


when running from regular python interperter, it works fine.

I need this script to run without python installed, so I've created a
stand-alone binary with py2exe. I used the following simple

from distutils.core import setup
import py2exe

setup(name = 'default',
      version = '0.1.0',
      console = [""],
      windows = [""]

when running from this binary I get this error:
Traceback (most recent call last):
  File "MainFrame.pyc", line 140, in OnSaveMenuEvent
  File "MainFrame.pyc", line 174, in dumpPrefs
  File "NS_Backup.pyc", line 64, in put
  File "pickle.pyc", line 1382, in dump
  File "pickle.pyc", line 231, in dump
  File "pickle.pyc", line 293, in save
  File "pickle.pyc", line 663, in save_dict
  File "pickle.pyc", line 677, in _batch_setitems
  File "pickle.pyc", line 293, in save
  File "pickle.pyc", line 514, in save_unicode
LookupError: no codec search functions registered: can't find encoding

I guess I should add some custom module to the but I don't know
which (or am I completely off track here...).

can someone help?


More information about the Python-list mailing list