Am 01.10.2014 17:48, schrieb Sibylle Koczian:
Hello,

when I try to start a Dabo application I get this:

sib@gespenst-lubuntu:~/src/dabo-master/ide$ ./Editor.py
Traceback (most recent call last):
   File "./Editor.py", line 1134, in <module>
     main()
   File "./Editor.py", line 1121, in main
     app.setup()
   File "/home/sib/src/dabo-master/dabo/dApp.py", line 339, in setup
     self.uiApp = dabo.ui.getUiApp(self, self.UIAppClass, callback=None,
forceNew=True)
   File "/home/sib/src/dabo-master/dabo/ui/uiwx/__init__.py", line 275,
in getUiApp
     ret = uiAppClass(app, callback)
   File "/home/sib/src/dabo-master/dabo/ui/uiwx/uiApp.py", line 115, in
__init__
     wx.App.__init__(self, 0, *args)
   File
"/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py", line
7981, in __init__
     self._BootstrapApp()
   File
"/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py", line
7555, in _BootstrapApp
     return _core_.PyApp__BootstrapApp(*args, **kwargs)
   File "/home/sib/src/dabo-master/dabo/ui/uiwx/uiApp.py", line 191, in
OnInit
     if not self.checkForUpdates():
   File "/home/sib/src/dabo-master/dabo/ui/uiwx/uiApp.py", line 213, in
checkForUpdates
     checkResult = self.dApp._checkForUpdates(force=force)
   File "/home/sib/src/dabo-master/dabo/dApp.py", line 587, in
_checkForUpdates
     dabo.log.error(_("Could not connect to the Dabo servers: %s") % e)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 42:
ordinal not in range(128)


I've looked at this again and put some diagnostic print statements into dApp.py. The Web update isn't really the problem, a mix of strings and unicode objects is.

The _ function changes the message
"Could not connect to the Dabo servers: %s"
to a unicode object (without translating it, for whatever reason).

But printing the exception object e and its type gives this:

print (e, type(e))
(URLError(error(110, 'Die Wartezeit f\xc3\xbcr die Verbindung ist abgelaufen'),), <class 'urllib2.URLError'>)

So the exception message is in German and contains the umlaut ü. And it's a string, in the system character set UTF-8, not a unicode object. I suppose this is directly from the system.

And the result of

x = u"some unicode %s" % "äöüß"

results in the UnicodeDecodeError, because we're using Python 2 here.

I strongly suspect similar problems at other places in the Dabo code; at least I've intermittent unicode related errors I can't explain from my own code.

So this should be fixed at some central place, but where?

Greetings,
Sibylle

_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/542eda8f.9020...@t-online.de

Reply via email to