gwibber-bugs team mailing list archive
-
gwibber-bugs team
-
Mailing list archive
-
Message #04239
[Bug 1166369] [NEW] Cannot update Twitter status behind proxy
Public bug reported:
I am using Gwibber on an up-to-date Ubuntu 12.10 machine, with Python
2.7.3 and Gwibber 3.6.0.
Updating the Twitter status works when running Gwibber without a HTTP proxy. When using a proxy, the update fails.
The gwibber.log shows this generic error message.
Network Thread-1 : ERROR - Network failure: UNKNOWN
The actual error is:
Network Thread-1 : ERROR - Network failure: maximum recursion depth exceeded
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/gwibber/microblog/network.py", line 35, in __init__
self.res = urllib2.urlopen(req)
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 401, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 419, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/dist-packages/gwibber/microblog/uploader/imageshack/urllib2_file.py", line 233, in https_open
return self.do_open(httplib.HTTPS, req)
File "/usr/lib/python2.7/dist-packages/gwibber/microblog/uploader/imageshack/urllib2_file.py", line 189, in do_open
h.putrequest('GET', req.get_selector())
File "/usr/lib/python2.7/urllib2.py", line 266, in get_selector
return self.__r_host
File "/usr/lib/python2.7/urllib2.py", line 225, in __getattr__
return getattr(self, attr)
File "/usr/lib/python2.7/urllib2.py", line 225, in __getattr__
return getattr(self, attr)
File "/usr/lib/python2.7/urllib2.py", line 225, in __getattr__
return getattr(self, attr)
File "/usr/lib/python2.7/urllib2.py", line 225, in __getattr__
return getattr(self, attr)
...
After digging a bit in the code, I noticed this monkey patching in gwibber/microblog/uploader/imageshack/urllib2_file.py, around line 228.
...
urllib2._old_HTTPHandler = urllib2.HTTPHandler
urllib2.HTTPHandler = newHTTPHandler
...
urllib2.HTTPSHandler = newHTTPSHandler
...
If I comment out those three lines, updating the Twitter status works
for me again, even behind a proxy.
If the modified handlers are still necessary, they may need some update
to work with Python 2.7.3 urllib2?
** Affects: gwibber
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Gwibber
Bug Heros, which is subscribed to Gwibber.
https://bugs.launchpad.net/bugs/1166369
Title:
Cannot update Twitter status behind proxy
Status in Gwibber:
New
Bug description:
I am using Gwibber on an up-to-date Ubuntu 12.10 machine, with Python
2.7.3 and Gwibber 3.6.0.
Updating the Twitter status works when running Gwibber without a HTTP proxy. When using a proxy, the update fails.
The gwibber.log shows this generic error message.
Network Thread-1 : ERROR - Network failure: UNKNOWN
The actual error is:
Network Thread-1 : ERROR - Network failure: maximum recursion depth exceeded
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/gwibber/microblog/network.py", line 35, in __init__
self.res = urllib2.urlopen(req)
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 401, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 419, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/dist-packages/gwibber/microblog/uploader/imageshack/urllib2_file.py", line 233, in https_open
return self.do_open(httplib.HTTPS, req)
File "/usr/lib/python2.7/dist-packages/gwibber/microblog/uploader/imageshack/urllib2_file.py", line 189, in do_open
h.putrequest('GET', req.get_selector())
File "/usr/lib/python2.7/urllib2.py", line 266, in get_selector
return self.__r_host
File "/usr/lib/python2.7/urllib2.py", line 225, in __getattr__
return getattr(self, attr)
File "/usr/lib/python2.7/urllib2.py", line 225, in __getattr__
return getattr(self, attr)
File "/usr/lib/python2.7/urllib2.py", line 225, in __getattr__
return getattr(self, attr)
File "/usr/lib/python2.7/urllib2.py", line 225, in __getattr__
return getattr(self, attr)
...
After digging a bit in the code, I noticed this monkey patching in gwibber/microblog/uploader/imageshack/urllib2_file.py, around line 228.
...
urllib2._old_HTTPHandler = urllib2.HTTPHandler
urllib2.HTTPHandler = newHTTPHandler
...
urllib2.HTTPSHandler = newHTTPSHandler
...
If I comment out those three lines, updating the Twitter status works
for me again, even behind a proxy.
If the modified handlers are still necessary, they may need some
update to work with Python 2.7.3 urllib2?
To manage notifications about this bug go to:
https://bugs.launchpad.net/gwibber/+bug/1166369/+subscriptions
Follow ups
References