Re: [dabo-users] Fw: Unicode Encode Error

Author: Zdravko Subakov

Posted: 2012-04-21 at 04:50:09

Ok, it took me a couple of hours but I can now mix all that I want and get

it on the form and even save it.(but we have new error on open file)

The change was in dabo/ui/uisx/dEditor.py the line is 1476 it was:

open(fname, "wb").write(self.GetText().encode(self.Encoding))

for some time it was:

codecs.open(fname,"wb").write(self.GetText().encode(self.Encoding))

and final solution was

codecs.open(fname,"wb").write(self.GetText().encode("utf-8"))

(with appropriate import codecs statement in the begining of the dEditor.py)

Of course it demanded reinstall, I suppose it would be enough to recompile

just that file but as I am newbie I might be speaking nonsense.

Before this solution I changed back what we did in utils.py (to CP-1252) and

removed the settings_override.py

the error I got now when I try to open saved file is:

**********************

C:\dabo\ide>python editor.py

Traceback (most recent call last):

File

"C:\Python27\lib\site-packages\dabo-0.9.4-py2.7.egg\dabo\ui\uiwx\dPemMixi

n.py", line 566, in __onWxMenuOpen

menu.raiseEvent(dEvents.MenuOpen, evt)

File

"C:\Python27\lib\site-packages\dabo-0.9.4-py2.7.egg\dabo\ui\uiwx\dPemMixi

n.py", line 1045, in raiseEvent

super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args,

**kwargs)

File

"C:\Python27\lib\site-packages\dabo-0.9.4-py2.7.egg\dabo\lib\eventMixin.p

y", line 81, in raiseEvent

bindingFunction(event)

File

"C:\Python27\lib\site-packages\dabo-0.9.4-py2.7.egg\dabo\ui\uiwx\dMenu.py

", line 94, in __onMenuHighlight

self._setDynamicEnabled()

File

"C:\Python27\lib\site-packages\dabo-0.9.4-py2.7.egg\dabo\ui\uiwx\dMenu.py

", line 107, in _setDynamicEnabled

item.Enabled = de()

File "editor.py", line 586, in <lambda>

DynamicEnabled=lambda:self.CurrentEditor.Modified, bmp="save",

help=_("Save

file"))

AttributeError: 'NoneType' object has no attribute 'Modified'

Traceback (most recent call last):

File

"C:\Python27\lib\site-packages\dabo-0.9.4-py2.7.egg\dabo\ui\uiwx\dMenuIte

m.py", line 58, in __onWxHit

self.raiseEvent(dEvents.Hit, evt)

File

"C:\Python27\lib\site-packages\dabo-0.9.4-py2.7.egg\dabo\ui\uiwx\dPemMixi

n.py", line 1045, in raiseEvent

super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args,

**kwargs)

File

"C:\Python27\lib\site-packages\dabo-0.9.4-py2.7.egg\dabo\lib\eventMixin.p

y", line 81, in raiseEvent

bindingFunction(event)

File "editor.py", line 770, in onFileOpen

fileNames = self.CurrentEditor.promptForFileName(prompt=_("Open"),

AttributeError: 'NoneType' object has no attribute 'promptForFileName'

***************************

I am getting tired of it.

Z.

_______________________________________________

Post Messages to: Dabo-users@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Searchable Archives: http://leafe.com/archives/search/dabo-users

This message: http://leafe.com/archives/byMID/219B2A7AEEBF4DE2B2DC18B26B3E1831@Perajoe

©2012 Zdravko Subakov