py2exe error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Haim Ashkenazi

    py2exe error

    Hi

    (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 !!!!
    try:
    f = open(self.bacFi le, "w")
    except:
    raise 'BadFileError', "couldn't write file"

    pickle.dump(con f, f)
    f.close()

    ---------------------------------

    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 setup.py:

    from distutils.core import setup
    import py2exe

    setup(name = 'default',
    version = '0.1.0',
    console = ["CLI_Backup .py"],
    windows = ["Configurator.p y"]
    )
    -------------------------

    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 setup.py but I don't know
    which (or am I completely off track here...).

    can someone help?

    thanx
    --
    Haim



  • Holger Duerer

    #2
    Re: py2exe error

    >>>>> "Haim" == Haim Ashkenazi <haim@babysnake s.org> writes:

    Haim> Hi
    Haim> (complete newbie warning...:) )

    Python or internet newbie?

    Google for 'py2exe "no codec search functions registered"'
    and click on 'I feel lucky'.


    Holger

    Comment

    Working...