CARVIEW |
joshthecoder / tweepy
- Source
- Commits
- Network (13)
- Issues (2)
- Downloads (17)
- Wiki (2)
- Graphs
-
Branch:
master
click here to add a description
click here to add a homepage
-
Feature Requestx
Here's a changeset with one approach:
https://github.com/brianmichelich/tweepy/commit/5cd1b3d1ce5d760e6c4e08af353c4c1ce406b475This allows you to set a proxy_host and proxy_port on the API() and have binder.py pick them up when creating a connection.
Comments
-
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: https://code.google.com/p/python-twitter/issues/detail?id=10
Comments
Please log in to comment.
We can already provide a proxy host via the "host" parameter in the API init method.
There is not a way to provide a port though which could be easily added. I will look into providing this in the next release. Thanks!
Unless I missed something a changed host parameter would allow for a reverse proxy and I was setting up a forward proxy.
The reverse proxy worked when I sent the request to foo.com and forwarded to twitter.com. Setting a hosts on the connection as well as the request allowed the forward proxy to work. This allowed me to use a forward proxy without setting it for the python environment.