Problem with time and locale

8 views
Skip to first unread message

vensign

unread,
Feb 1, 2010, 3:26:18 PM2/1/10
to tweepy
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?

Josh Roesslein

unread,
Feb 1, 2010, 4:43:44 PM2/1/10
to twe...@googlegroups.com
I have opened an issue for this bug here [1].
Will look into this issue and report a fix once one is available.

Thank you for the report!

Josh

[1] http://github.com/joshthecoder/tweepy/issues#issue/13
Reply all
Reply to author
Forward
0 new messages