我有與wxPython的wxpython 3.0打破舊應用程序? (區域設置錯誤)
與wxPython的3.0,現在的老verions正常運行的應用試圖運行應用程序時,我收到以下錯誤
File "C:\Python27\lib\site-packages\wx-3.0-msw\wx\_controls.py", line 6523, in __init__
_controls_.DatePickerCtrl_swiginit(self,_controls_.new_DatePickerCtrl(*args, **kwargs))
wx._core.PyAssertionError: C++ assertion "strcmp(setlocale(LC_ALL, NULL), "C") == 0" failed at ..\..\src\common\intl.cpp(1449) in wxLocale::GetInfo(): You probably called setlocale() directly instead of using wxLocale and now there is a mismatch between C/C++ and Windows locale.
Things are going to break, please only change locale by creating wxLocale objects to avoid this!
的錯誤出現從該行
File "C:\Users\hadi\Dropbox\Projects\Python\dialysis\profile.py", line 159, in __init__
style=wx.DP_DROPDOWN)
幫助深表感謝
你可以顯示相關代碼來創建'wx.DatePickerCtrl'嗎? – Fenikso
self.date1 = wx.DatePickerCtrl(self,size =( - 1,-1), style = wx.DP_DROPDOWN) – Hadi
嗯。這對我行得通。除了這個例外,你真的做了一些Locale魔法嗎?你可以創建儘可能小的可運行示例,我們可以使用它並運行以重現您的問題?順便說一句:你可以省略'size =( - 1,-1)',因爲這是隱式值和可選參數。 – Fenikso