Hi all,
test_strptime.py (1.2 KB)
the attached code runs fine on :
- various linux, with wxpython 4.0.7 / 4.1.0, and python 3.6 / 3.7 / 3.8
- windows, with wxpython 4.0.7, and python 3.7
but it failes in that case :
- windows, with wxpython 4.1.0 and python 3.7
I get this following error :
---> locale.GetName() = fr_FR
Traceback (most recent call last):
File "test_strptime.py", line 39, in OnInit
self.diag = Test()
File "test_strptime.py", line 32, in __init__
date_out = date2num(datetime.datetime.strptime(date_in, '%Y%m%d%H%M'))
File "C:\Users\regis\AppData\Local\Programs\Python\Python37\lib\_strptime.py", line 277, in <module>
_TimeRE_cache = TimeRE()
File "C:\Users\regis\AppData\Local\Programs\Python\Python37\lib\_strptime.py", line 191, in __init__
self.locale_time = LocaleTime()
File "C:\Users\regis\AppData\Local\Programs\Python\Python37\lib\_strptime.py", line 69, in __init__
self.lang = _getlang()
File "C:\Users\regis\AppData\Local\Programs\Python\Python37\lib\_strptime.py", line 28, in _getlang
return locale.getlocale(locale.LC_TIME)
File "C:\Users\regis\AppData\Local\Programs\Python\Python37\lib\locale.py", line 587, in getlocale
return _parse_localename(localename)
File "C:\Users\regis\AppData\Local\Programs\Python\Python37\lib\locale.py", line 495, in _parse_localename
raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: fr-FR
Can you reproduce this kind of issue too with windows system, wxpython 4.1.0 only, and python3.7 ?
What can be done to fix this ?
Note :
I use virtualenv in case this is relevant
Thank you for your attention