DatePickerCtrl bug?

Hi all,

Attached program fails (Windows XP, Python 2.4.1, wxPython 2.7.1.3) with the following output:

Traceback (most recent call last):
   File "datepickerctrlbug.py", line 13, in ?
     frame = Frame(None)
   File "datepickerctrlbug.py", line 10, in __init__
     print self.dpc.GetValue()
   File "C:\Program Files\Python24\lib\site-packages\wx-2.7.1-msw-unicode\wx\_controls.py", line 6408, in GetValue
     return _controls_.DatePickerCtrl_GetValue(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "m_date.IsValid() == dt.IsValid() && (!dt.IsValid() || dt == m_date)" failed at ..\..\src\msw\datectrl.cpp(272) in wxDatePickerCtrl::GetValue(): bug in wxDatePickerCtrl: m_date not in sync

With wxPython 2.6.3.2 all is fine.

Cheers, Frank

datepickerctrlbug.py (407 Bytes)

Frank Niessink:

···

wxversion.select('2.6') # change this to 2.7 of course...

Frank Niessink wrote:

Hi all,

Attached program fails (Windows XP, Python 2.4.1, wxPython 2.7.1.3) with the following output:

Traceback (most recent call last):
  File "datepickerctrlbug.py", line 13, in ?
    frame = Frame(None)
  File "datepickerctrlbug.py", line 10, in __init__
    print self.dpc.GetValue()
  File "C:\Program Files\Python24\lib\site-packages\wx-2.7.1-msw-unicode\wx\_controls.py", line 6408, in GetValue
    return _controls_.DatePickerCtrl_GetValue(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "m_date.IsValid() == dt.IsValid() && (!dt.IsValid() || dt == m_date)" failed at ..\..\src\msw\datectrl.cpp(272) in wxDatePickerCtrl::GetValue(): bug in wxDatePickerCtrl: m_date not in sync

With wxPython 2.6.3.2 all is fine.

Thanks. Fixed. (You can probably work around this until the next release by passing a date where the time values are all zeroed out.)

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!