py2exe error

H

Haim Ashkenazi

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.bacFile, "w")
except:
raise 'BadFileError', "couldn't write file"

pickle.dump(conf, 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.py"]
)
-------------------------

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
 
H

Holger Duerer

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

About py2exe "bundle_files" setting? 9
Py2exe and Module Error... 4
py2exe problem 1
py2exe and msvcp90.dll 3
SQLalchemy+py2exe+pymssql error 0
Tkinter vs. py2exe problem 5
DrPython and py2exe 10
py2exe question 1

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top