gnumed-bugs
[Top][All Lists]
Advanced

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

Re: [Gnumed-bugs] <bug>: Dieser Fehler trat auf, als ich einen neu


From: Karsten Hilbert
Subject: Re: [Gnumed-bugs] <bug>: Dieser Fehler trat auf, als ich einen neu
Date: Tue, 3 Aug 2010 15:30:01 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

Hallo Armin,

> > > client version: 0.7.7
...
> > > 2010-07-24 20:24:15  DEBUG     gm.gui
> > > (/usr/lib/python2.6/site-packages/Gnumed/wxpython/gmExceptionHandlingWidg
> > >ets.py::handle_uncaught_exception_wx() #49): unhandled exception caught:
> > > Traceback (most recent call last):
> > >   File "/usr/lib/python2.6/site-packages/Gnumed/wxpython/gmEditArea.py",
> > > line 253, in _on_save_button_pressed if self._PNL_ea.save():
> > >   File "/usr/lib/python2.6/site-packages/Gnumed/wxpython/gmEditArea.py",
> > > line 144, in save if not self._valid_for_save():
> > >   File
> > > "/usr/lib/python2.6/site-packages/Gnumed/wxpython/gmDemographicsWidgets.p
> > >y", line 2373, in _valid_for_save return (self.__identity_valid_for_save()
> > > and self.__address_valid_for_save(empty_address_is_valid = True)) File
> > > "/usr/lib/python2.6/site-packages/Gnumed/wxpython/gmDemographicsWidgets.p
> > >y", line 2182, in __identity_valid_for_save elif dob >
> > > gmDateTime.wx_now_here(wx = wx):
> > >   File "/usr/lib/python2.6/site-packages/Gnumed/pycommon/gmDateTime.py",
> > > line 203, in wx_now_here return py_dt2wxDate(py_dt = pydt_now_here(), wx
> > > = wx)
> > >   File "/usr/lib/python2.6/site-packages/Gnumed/pycommon/gmDateTime.py",
> > > line 240, in py_dt2wxDate wxdt.SetYear(py_dt.year)
> > >   File
> > > "/usr/local/lib/python2.6/site-packages/wx-2.8-gtk2-unicode/wx/_misc.py",
> > > line 3656, in SetYear return _misc_.DateTime_SetYear(*args, **kwargs)
> > > PyAssertionError: C++ assertion "IsValid()" failed at
> > > ../include/wx/datetime.h(1688) in GetTicks(): invalid wxDateTime
> >
> > I have unsuccessfully tried to reproduce this under
> > Debian/Squeeze. Can you please give a more detailed
> > description how I can povoke this problem ?

> Hallo Karsten,
> Vielen Dank für deine Antwort. Vielleicht helfen ja die weiteren Infos, den 
> Fehler erklären, reproduzieren und abstellen zu können.
> 
> Ich nutze Suse 11.1.

Suse 11.1. ist OK.

> Das ist die Python-Version, die ich installiert habe:
> Python 2.6 (r26:66714, Mar 30 2010, 00:30:21)

2.6 ist OK.

> Das bekomme ich als Ausgabe, wenn ich gnumed in der console starte:
> /usr/lib/python2.6/site-packages/Gnumed/pycommon/gmTools.py:11: 
> DeprecationWarning: the MimeWriter module is deprecated; use the email 
> package instead
>  import urllib2 as wget, decimal, StringIO, MimeWriter, mimetypes, mimetools

Kein Problem.

> Traceback (most recent call last):
>   File "/usr/lib/python2.6/logging/__init__.py", line 765, in emit
>     self.stream.write(fs % msg.encode("UTF-8"))
>   File "/usr/lib/python2.6/codecs.py", line 686, in write
>     return self.writer.write(data)
>   File "/usr/lib/python2.6/codecs.py", line 351, in write
>     data, consumed = self.encode(object, self.errors)
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 167: 
> ordinal not in range(128)
> Traceback (most recent call last):
>   File "/usr/lib/python2.6/logging/__init__.py", line 765, in emit
>     self.stream.write(fs % msg.encode("UTF-8"))
>   File "/usr/lib/python2.6/codecs.py", line 686, in write
>     return self.writer.write(data)
>   File "/usr/lib/python2.6/codecs.py", line 351, in write
>     data, consumed = self.encode(object, self.errors)
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 162: 
> ordinal not in range(128)
> Traceback (most recent call last):
>   File "/usr/lib/python2.6/logging/__init__.py", line 765, in emit
>     self.stream.write(fs % msg.encode("UTF-8"))
>   File "/usr/lib/python2.6/codecs.py", line 686, in write
>     return self.writer.write(data)
>   File "/usr/lib/python2.6/codecs.py", line 351, in write
>     data, consumed = self.encode(object, self.errors)
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 197: 
> ordinal not in range(128)

Das Python auf dieser Maschine (oder die Shell) lebt
augenscheinlich noch im 19. Jahrhundert.


> DISPATCHER WARNING: connect(): unknown signal [test_result_mod_db]
> DISPATCHER WARNING: connect(): unknown signal [substance_intake_mod_db]

OK

> which: no aeskulap in 
> (/opt/kde3/bin:/home/armin/bin:/usr/local/bin:/usr/bin:/bi                    
>           
> n:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/bin:/usr/lib/mit/bin:/usr/lib/mit/
>                               
> sbin:/usr/lib/qt3/bin:/opt/real/RealPlayer:/usr/local/lib)
> which: no amide in 
> (/opt/kde3/bin:/home/armin/bin:/usr/local/bin:/usr/bin:/bin:/                 
>              
> usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/bin:/usr/lib/mit/bin:/usr/lib/mit/sbi
>                               
> n:/usr/lib/qt3/bin:/opt/real/RealPlayer:/usr/local/lib)
> which: no xmedcon in 
> (/opt/kde3/bin:/home/armin/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/bin:/usr/lib/mit/bin:/usr/lib/mit/s
>                               
> bin:/usr/lib/qt3/bin:/opt/real/RealPlayer:/usr/local/lib)

OK

> DISPATCHER WARNING: connect(): unknown signal [message_inbox_generic_mod_db]

OK

> Ich kann mir vorstellen, dass es vielleicht gar nicht direkt mit gnumed zu 
> tun 
> hat, sondern eher mit meiner Python-Version.

Der "Fehler" hat eher was mit der wxPython-Version zu tun:

GNUmed:

> > >   File "/usr/lib/python2.6/site-packages/Gnumed/pycommon/gmDateTime.py", 
> > > line 240, in py_dt2wxDate wxdt.SetYear(py_dt.year)

ruft wxPython auf:

> > >   File 
> > > "/usr/local/lib/python2.6/site-packages/wx-2.8-gtk2-unicode/wx/_misc.py", 
> > > line 3656, in SetYear return _misc_.DateTime_SetYear(*args, **kwargs)

wodrinnen dann das Problem auftritt (also *unterhalb* von GNUmed):

> > > PyAssertionError: C++ assertion "IsValid()" failed at 
> > > ../include/wx/datetime.h(1688) in GetTicks(): invalid wxDateTime

1) das hier verwendete (2010) Jahr (_misc_.DateTime_SetYear()) ist nicht 
illegal (siehe log)

2) assertions werden nur in debug-builds von wxPython verwendet

3) diese assertion prüft, ob nach dem Setzen des Jahres das Gesamtdatum legal 
ist

4) ist es nicht, weil wir als Ausgangpunkt für die Konstruktion des Datums
   wx.DateTime() verwenden, aus welchem wxPython wxDateTimeInvalid zurückliefert

5) das finden wir auch gut, weil wir dann erst nach   
   erfolgreichem Setzen aller Felder ein valides Datum haben,
   nicht ein halbgewalktes nach z.B. Setzen einiger Felder und
   dann Fehler, daher verwenden wird als Ausgangspunkt nicht
   z.B. "jetzt"

6) die assertion ist mE völlig unsinnig, da egal mit welchem Teilfeld man
   anfängt, das Datum zu Beginn immer ungültig ist

7) soll die assertion Sinn haben, fragt sich, wozu wxPython überhaupt ein
   ungültiges Datum zurückgibt:

address@hidden:~$ python
Python 2.6.5+ (release26-maint, Jul  6 2010, 14:48:45)
[GCC 4.4.4] on linux2Type "help", "copyright", "credits" or "license" for more 
information.
        >>> import wx
        >>> wx.DateTime()
        <wx.DateTime: "INVALID" at _18578409_p_wxDateTime
        >>>

8) IsValid() sollte logischerweise nicht fehlschlagen, sondern Falsch 
zurückgeben ...

Alles in allem muß man sich fragen, wie das bei Suse mit
wxPython gedacht ist.

Man könnte nun mittels 5) um das Problem 4) herumarbeiten,
würde sich aber eben das mE schlimmere Problem des u.U.
zwar technisch gültigen, aber inhaltlich falschen Datums
einhandeln. Sowas macht GNUmed nicht, wo es sich vermeiden
läßt.

Ich kann nur die Empfehlung aussprechen, auf Suse mal
wxPython als Production Build anstelle von Debug Build
auszuprobieren.

Viele Grüße !

Karsten
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346



reply via email to

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