Reported by vensign on mailing list:
When I try to run my app with the LANG=es_VE.UTF8 I get the following
error:
File "/home/wako/Documentos/twclient/origami.py", line 37, in
checkuser
if not self.api.verify_credentials():
File "build/bdist.linux-x86_64/egg/tweepy/api.py", line 259, in
verify_credentials
File "build/bdist.linux-x86_64/egg/tweepy/binder.py", line 185, in
_call
File "build/bdist.linux-x86_64/egg/tweepy/binder.py", line 171, in
execute
File "build/bdist.linux-x86_64/egg/tweepy/parsers.py", line 73, in
parse
File "build/bdist.linux-x86_64/egg/tweepy/models.py", line 85, in
parse
File "build/bdist.linux-x86_64/egg/tweepy/models.py", line 50, in
parse
File "build/bdist.linux-x86_64/egg/tweepy/utils.py", line 14, in
parse_datetime
File "/usr/lib/python2.6/_strptime.py", line 454, in _strptime_time
return _strptime(data_string, format)[0]
File "/usr/lib/python2.6/_strptime.py", line 325, in _strptime
(data_string, format))
ValueError: time data 'Mon Feb 01 18:45:13 +0000 2010' does not match
format '%a %b %d %H:%M:%S +0000 %Y'
After some tests I discover that the problem is the locale settings,
i.e. in my language %a = Mon will be %a=Lun.
If I set LANG=en_US.UTF-8 the problem go away.
So for now I put this line in my app code:
locale.setlocale(locale.LC_ALL, 'C')
And that fix the problem.
Is there anyway to fix this in the tweepy library?
Similar issue reported for python-twitter: http://code.google.com/p/python-twitter/issues/detail?id=10