gnumed-bugs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-bugs] <bug>: Acesso pela primeira vez...


From: Karsten Hilbert
Subject: Re: [Gnumed-bugs] <bug>: Acesso pela primeira vez...
Date: Mon, 31 Oct 2011 14:17:58 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Hello Joseph,

thanks for your report.

> user comment  : Acesso pela primeira vez...
> 
> client version: 0.9.9

You will want to upgrade to 0.9.11.

This is strange:

> 2011-10-29 22:15:55  DEBUG     gm.i18n 
> (/usr/share/gnumed/Gnumed/pycommon/gmI18N.py::__log_locale_settings() #127): 
> locale.get_locale(): ('pt_BR', 'UTF-8')
> 2011-10-29 22:15:55  DEBUG     gm.i18n 
> (/usr/share/gnumed/Gnumed/pycommon/gmI18N.py::__log_locale_settings() #129): 
> locale.get_locale(LC_NUMERIC): ('pt_BR', 'ISO8859-1')
> 2011-10-29 22:15:55  DEBUG     gm.i18n 
> (/usr/share/gnumed/Gnumed/pycommon/gmI18N.py::__log_locale_settings() #129): 
> locale.get_locale(LC_MESSAGES): ('pt_BR', 'UTF-8')
> 2011-10-29 22:15:55  DEBUG     gm.i18n 
> (/usr/share/gnumed/Gnumed/pycommon/gmI18N.py::__log_locale_settings() #129): 
> locale.get_locale(LC_MONETARY): ('pt_BR', 'ISO8859-1')
> 2011-10-29 22:15:55  DEBUG     gm.i18n 
> (/usr/share/gnumed/Gnumed/pycommon/gmI18N.py::__log_locale_settings() #129): 
> locale.get_locale(LC_COLLATE): ('pt_BR', 'UTF-8')
> 2011-10-29 22:15:55  DEBUG     gm.i18n 
> (/usr/share/gnumed/Gnumed/pycommon/gmI18N.py::__log_locale_settings() #129): 
> locale.get_locale(LC_CTYPE): ('pt_BR', 'UTF-8')
> 2011-10-29 22:15:55  DEBUG     gm.i18n 
> (/usr/share/gnumed/Gnumed/pycommon/gmI18N.py::__log_locale_settings() #129): 
> locale.get_locale(LC_TIME): ('pt_BR', 'ISO8859-1')

because it means some parts of the system will use the
iso-8859-1 encoding (eg time) while other parts (say,
messages) will be utf8.

This likely confuses gmI18N.get_encoding() (and likewise
Python's str.decode() which is why setting the time fails:

> Traceback (most recent call last):
>   File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
>     "__main__", fname, loader, pkg_name)
>   File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
>     exec code in run_globals
>   File "/usr/share/gnumed/Gnumed/gnumed.py", line 526, in <module>
>     gmGuiMain.main()
>   File "/usr/share/gnumed/Gnumed/wxpython/gmGuiMain.py", line 3350, in main
>     app = gmApp(redirect = False, clearSigInt = False)
>   File "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py", 
> line 7978, in __init__
>     self._BootstrapApp()
>   File "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py", 
> line 7552, in _BootstrapApp
>     return _core_.PyApp__BootstrapApp(*args, **kwargs)
>   File "/usr/share/gnumed/Gnumed/wxpython/gmGuiMain.py", line 2839, in OnInit
>     frame = gmTopLevelFrame(None, -1, _('GNUmed client'), (640, 440))
>   File "/usr/share/gnumed/Gnumed/wxpython/gmGuiMain.py", line 112, in __init__
>     self.setup_statusbar()
>   File "/usr/share/gnumed/Gnumed/wxpython/gmGuiMain.py", line 2770, in 
> setup_statusbar
>     self._cb_update_clock()
>   File "/usr/share/gnumed/Gnumed/wxpython/gmGuiMain.py", line 2777, in 
> _cb_update_clock
>     st = time.strftime('%c', t).decode(gmI18N.get_encoding())
>   File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
>     return codecs.utf_8_decode(input, errors, True)
> UnicodeDecodeError: 'utf8' codec can't decode byte 0xe1 in position 1: 
> invalid continuation byte

...

> 2011-10-29 22:17:00  DEBUG     gm.logging 
> (/usr/share/gnumed/Gnumed/pycommon/gmLog2.py::log_stack_trace() #155): >>> 
> execution frame [decode] in [/usr/lib/python2.7/encodings/utf_8.py] at line 
> 16 <<<
> 2011-10-29 22:17:00  DEBUG     gm.logging 
> (/usr/share/gnumed/Gnumed/pycommon/gmLog2.py::log_stack_trace() #170):        
>         input = S???b 29 Out 2011 22:17:00 BRST
> 2011-10-29 22:17:00  DEBUG     gm.logging 
> (/usr/share/gnumed/Gnumed/pycommon/gmLog2.py::log_stack_trace() #170):        
>        errors = strict

I changed the code to ignore encdoding errors but this will
only be released with 1.1.1 and 1.2.

Karsten
-- 
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346



reply via email to

[Prev in Thread] Current Thread [Next in Thread]