Skip to content

Commit aaa0295

Browse files
committed
Updated to the latest version
1 parent ea23c89 commit aaa0295

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Lib/test/test_urllib2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def getheaders(self, name):
300300
class MockResponse(io.StringIO):
301301
def __init__(self, code, msg, headers, data, url=None):
302302
io.StringIO.__init__(self, data)
303-
self.code, self.msg, self.headers, self.url = code, msg, headers, url
303+
self.status, self.msg, self.headers, self.url = code, msg, headers, url
304304

305305
def info(self):
306306
return self.headers

Lib/urllib/request.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def urlretrieve(url, filename=None, reporthook=None, data=None):
210210
url_type, path = _splittype(url)
211211

212212
with contextlib.closing(urlopen(url, data)) as fp:
213-
headers = fp.info()
213+
headers = fp.headers
214214

215215
# Just return the local path and the "headers" for file://
216216
# URLs. No sense in performing a copy unless requested.
@@ -594,7 +594,7 @@ class HTTPErrorProcessor(BaseHandler):
594594
handler_order = 1000 # after all other processing
595595

596596
def http_response(self, request, response):
597-
code, msg, hdrs = response.code, response.msg, response.info()
597+
code, msg, hdrs = response.status, response.msg, response.headers
598598

599599
# According to RFC 2616, "2xx" code indicates that the client's
600600
# request was successfully received, understood, and accepted.
@@ -1338,8 +1338,7 @@ def do_open(self, http_class, req, **http_conn_args):
13381338
# This line replaces the .msg attribute of the HTTPResponse
13391339
# with .headers, because urllib clients expect the response to
13401340
# have the reason in .msg. It would be good to mark this
1341-
# attribute is deprecated and get then to use info() or
1342-
# .headers.
1341+
# attribute is deprecated and get then to use .headers.
13431342
r.msg = r.reason
13441343
return r
13451344

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,7 @@ Dustin J. Mitchell
12701270
Gideon Mitchell
12711271
Tim Mitchell
12721272
Zubin Mithra
1273+
Alexandr Mitin
12731274
Florian Mladitsch
12741275
Kevin Modzelewski
12751276
Doug Moen

0 commit comments

Comments
 (0)