wx.DatePickerCtrl and style=wx.DP_ALLOWNONE (wxPython 2.7.2.0)

Hi,

Just in case there will be a bugfix release on the 2.7.2 branch. This:

import wx
app = wx.App(None)
frame = wx.Frame(None)
dpc = wx.DatePickerCtrl(frame, style=wx.DP_ALLOWNONE)

gives this traceback:

Traceback (most recent call last):
   File "dpc.py", line 8, in ?
     dpc = wx.DatePickerCtrl(frame, style=wx.DP_ALLOWNONE)
   File "c:\Program Files\Python24\lib\site-packages\wx-2.7.2-msw-unicode\wx\_controls.py", line 6373, in __init__
_controls_.DatePickerCtrl_swiginit(self,_controls_.new_DatePickerCtrl(*args,
  **kwargs))
wx._core.PyAssertionError: C++ assertion "(0 < day) && (day <= GetNumberOfDays(month, year))" failed at ..\..\src\common\datetime.cpp(1423) in wxDateTime::Set()
: Invalid date in wxDateTime::Set()

on wxPython 2.7.2.0 (Python 2.4, Windows XP). wxPython 2.8 is ok.

Cheers, Frank

Hello, I just got the same error in wxPython 2.9.5 with python 2.7 (using ‘wine’)

File “C:\Python27\lib\site-packages\wx-2.9.5-msw\wx_controls.py”, line 6451, in SetValue

return controls.DatePickerCtrlBase_SetValue(*args, **kwargs)

PyAssertionError: C++ assertion “(0 < day) && (day <= GetNumberOfDays(month, year))” failed at …..\src\common\datetime.cpp(1195) in wxDateTime::Set(): Invalid date in wxDateTime::Set()

It seams all the data in the datetime is fine

09/29/13 00:00:00 <wx.DateTime: “09/29/13 00:00:00” at _00df0b05_p_wxDateTime>

Any idea about the reason?

Thanks,

Iskren

···

On Sunday, December 3, 2006 5:53:04 PM UTC+2, Frank Niessink wrote:

Hi,
Just in case there will be a bugfix release on the 2.7.2 branch. This:

import wx
app = wx.App(None)
frame = wx.Frame(None)
dpc = wx.DatePickerCtrl(frame, style=wx.DP_ALLOWNONE)

gives this traceback:

Traceback (most recent call last):
File “dpc.py”, line 8, in ?
dpc = wx.DatePickerCtrl(frame, style=wx.DP_ALLOWNONE)
File “c:\Program
Files\Python24\lib\site-packages\wx-2.7.2-msw-unicode\wx_controls.py”,
line 6373, in init

controls.DatePickerCtrl_swiginit(self,controls.new_DatePickerCtrl(*args,
**kwargs))
wx._core.PyAssertionError: C++ assertion “(0 < day) && (day <=
GetNumberOfDays(month, year))” failed at
…..\src\common\datetime.cpp(1423) in wxDateTime::Set()
: Invalid date in wxDateTime::Set()

on wxPython 2.7.2.0 (Python 2.4, Windows XP). wxPython 2.8 is ok.

Cheers, Frank