gesomax / httplib2

Automatically exported from code.google.com/p/httplib2
0 stars 0 forks source link

httplib2 for python3 raised UnboundLocalError: local variable 'msg' referenced before assignment #79

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
The exception occured randomly, and I have no idea to reproduce it.

What is the expected output? What do you see instead?
self-defined error message, but instead I got the the UnboundLocalError 
exception.

What version of the product are you using? On what operating system?
httplib2-python3-0.5.0 on Windows XP with Service Pack 2

Please provide any additional information below.
Here is the exception's traceback information:
Traceback (most recent call last):
  File "C:\Python31\lib\socketserver.py", line 558, in 
process_request_thread
    self.finish_request(request, client_address)
  File "C:\Python31\lib\socketserver.py", line 320, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "C:\Python31\lib\socketserver.py", line 614, in __init__
    self.handle()
  File "E:\zhangyl\NewsEntry\tools\downloader.py", line 34, in handle
    req, content = self.hHttp.request(self.data.decode(encoding))
  File "C:\Python31\lib\site-packages\httplib2\__init__.py", line 1058, in 
request
    (response, new_content) = self._request(conn, authority, uri, 
request_uri, method, body, headers, redirections, cachekey)
  File "C:\Python31\lib\site-packages\httplib2\__init__.py", line 873, in 
_request
    (response, content) = self._conn_request(conn, request_uri, method, 
body, headers)
  File "C:\Python31\lib\site-packages\httplib2\__init__.py", line 835, in 
_conn_request
    conn.request(method, request_uri, body, headers)
  File "C:\Python31\lib\http\client.py", line 918, in request
    self._send_request(method, url, body, headers)
  File "C:\Python31\lib\http\client.py", line 956, in _send_request
    self.endheaders(body)
  File "C:\Python31\lib\http\client.py", line 914, in endheaders
    self._send_output(message_body)
  File "C:\Python31\lib\http\client.py", line 768, in _send_output
    self.send(msg)
  File "C:\Python31\lib\http\client.py", line 716, in send
    self.connect()
  File "C:\Python31\lib\site-packages\httplib2\__init__.py", line 725, in 
connect
    raise socket.error(msg)
UnboundLocalError: local variable 'msg' referenced before assignment

Original issue reported on code.google.com by jonathan.Admin on 9 Dec 2009 at 7:51

GoogleCodeExporter commented 8 years ago
The tip revision that doesn't fix this issue.
There are my patch available,  but needs more testing.

http://code.google.com/r/msmhrt-httplib2/source/detail?r=d0867e0ba6a963bc387420f
c6178baa102cf1248

Original comment by msm...@gmail.com on 10 Oct 2010 at 12:45

GoogleCodeExporter commented 8 years ago

Original comment by joe.gregorio@gmail.com on 13 Feb 2011 at 5:02