[wxPython-users] ANN: GUI2Exe for wxPython :-D
Andrea Gavana
andrea.gavana at gmail.com
Sun Apr 1 17:36:11 PDT 2007
Hi Roee,
On 4/2/07, roee shlomo wrote:
> I did successfully run the program by not sending dbName to the DataBase
> object (which causes the db file to be stored in the application path). It
> works quite well, except for saving projects:
>
> Traceback (most recent call last):
> File "C:\Download\GUI2Exe_source\GUI2Exe.py", line 389,
> in OnSaveProject
> self.SaveProject(project)
> File "C:\Download\GUI2Exe_source\GUI2Exe.py", line 770,
> in SaveProject
> self.dataBase.SaveProject(project)
> File "C:\Download\GUI2Exe_source\DataBase.py", line 62,
> in SaveProject
> self.db[key] = serialize(project)
> File "C:\Python25\lib\bsddb\__init__.py", line 230, in
> __setitem__
> _DeadlockWrap(wrapF) # self.db[key] = value
> File "C:\Python25\lib\bsddb\dbutils.py", line 62, in
> DeadlockWrap
> return function(*_args, **_kwargs)
> File "C:\Python25\lib\bsddb\__init__.py", line 229, in
> wrapF
> self.db[key] = value
> TypeError: String or Integer object expected for key, unicode found
>
> Again unicode issues.
Yeah, that's my fault, on my machines I still have ansi build... I
know I know, my bad :-D . By the way, I got rid of the ansi builds and
installed the unicode one. Well, I don't know if this is the right
solution or not, but I inserted at the beginning of GUI2Exe.py these
lines:
# This is *really* ugly
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
del sys.setdefaultencoding
And then used wx.SetDefaultPyEncoding("utf-8"), I am not sure "utf-8"
will be enough for all the cases (probably not), but the world of
encodings is still a bit obscure to me. In any case, noting that bsddb
doesn't like unicode objects as keys, I just encode()d them before
passing to it. I don't think it's an elegant solution, but at the
moment I am short of ideas...
I re-uploaded the new source and installer in the usual place. I don't
think it will make any difference, but if someone could try it I would
ben very happy :-D
Thank you.
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/
More information about the wxpython-users
mailing list