diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2009-02-11 00:39:14 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2009-02-11 00:39:14 (GMT) |
commit | b353c12a9caa20e90466af6a8f17a227b72e4f23 (patch) | |
tree | 324c9dde570196bd47044f262e7387aef652919a /Lib/urllib/request.py | |
parent | 651453ace09e6677d8fea66d3cbbf8614b109f16 (diff) | |
download | cpython-b353c12a9caa20e90466af6a8f17a227b72e4f23.zip cpython-b353c12a9caa20e90466af6a8f17a227b72e4f23.tar.gz cpython-b353c12a9caa20e90466af6a8f17a227b72e4f23.tar.bz2 |
Issue #4631: Fix urlopen() result when an HTTP response uses chunked encoding.
Diffstat (limited to 'Lib/urllib/request.py')
-rw-r--r-- | Lib/urllib/request.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 63ce6d4..b86d8f2 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -333,7 +333,6 @@ class OpenerDirector: handlers = chain.get(kind, ()) for handler in handlers: func = getattr(handler, meth_name) - result = func(*args) if result is not None: return result @@ -1070,7 +1069,8 @@ class AbstractHTTPHandler(BaseHandler): except socket.error as err: # XXX what error? raise URLError(err) - resp = addinfourl(r.fp, r.msg, req.get_full_url()) +## resp = addinfourl(r.fp, r.msg, req.get_full_url()) + resp = addinfourl(r, r.msg, req.get_full_url()) resp.code = r.status resp.msg = r.reason return resp @@ -1606,7 +1606,7 @@ class URLopener: # According to RFC 2616, "2xx" code indicates that the client's # request was successfully received, understood, and accepted. if 200 <= response.status < 300: - return addinfourl(response.fp, response.msg, "http:" + url, + return addinfourl(response, response.msg, "http:" + url, response.status) else: return self.http_error( |