Re: [PyKDE] eric3 VariableViewer crashes on non-utf8 strings

2004-10-13 Thread Detlev Offenbach
Hi,

thanks for your report. A fix for this will be in the next 3.5 bug fix release 
and in the next snapshot of the 3.6 development.

Detlev

Am Mittwoch, 13. Oktober 2004 15:07 schrieb Krystof Zacek:
> This is caused by file
>
> /usr/lib/python2.3/site-packages/eric/Debugger/VariablesViewer.py
>
> in line 262:
>
>  try:
>   slist = unicode(list[i], 'utf-8')
>  except TypeError:
>   slist = str(list[i])
>
> If the variable string contains a character which is not convertable from
> utf8 (like e.g. czech nationale characters encoded in  iso-8859-2), then
> the unicode() raises exception UnicodeDecodeError, which is not trapped by
> the eric code.
>
> I dare to suggest the following change:
>
>  import locale
>
>  try:
>   slist = unicode(list[i], locale.getlocale()[1])
>  except TypeError:
>   slist = str(list[i])
>
> ___
> PyKDE mailing list[EMAIL PROTECTED]
> http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

-- 
Detlev Offenbach
[EMAIL PROTECTED]

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


[PyKDE] eric3 VariableViewer crashes on non-utf8 strings

2004-10-13 Thread Krystof Zacek
This is caused by file

/usr/lib/python2.3/site-packages/eric/Debugger/VariablesViewer.py

in line 262:

 try:
  slist = unicode(list[i], 'utf-8')
 except TypeError:
  slist = str(list[i])

If the variable string contains a character which is not convertable from utf8 
(like e.g. czech nationale characters encoded in  iso-8859-2), then the 
unicode() raises exception UnicodeDecodeError, which is not trapped by the 
eric code.

I dare to suggest the following change:

 import locale

 try:
  slist = unicode(list[i], locale.getlocale()[1])
 except TypeError:
  slist = str(list[i])

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde