Simplify the Request class. The basic components of the parsed
Request are now available as public attributes, e.g. full_url and
host. The accessor methods are deprecated. The implementation
replace the complicated __getattr__ machinery with a _parse() method.
The response from an HTTP request is now an HTTPResponse instance
instead of an addinfourl() wrapper instance. The wrapper provided
minimal extract functionality and was undocumented. The API of
addinfourl() was preserved, except for close hooks, by adding a few
methods and public attributes to the HTTPResponse class.
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
index e590111..c8be440 100644
--- a/Lib/test/test_urllib2.py
+++ b/Lib/test/test_urllib2.py
@@ -683,8 +683,13 @@
self.msg = msg
self.status = status
self.reason = reason
+ self.code = 200
def read(self):
return ''
+ def info(self):
+ return {}
+ def geturl(self):
+ return self.url
class MockHTTPClass:
def __init__(self):
self.level = 0