• Home
  • Raw
  • Download

Lines Matching refs:urllib2

9 import urllib2
10 from urllib2 import Request, OpenerDirector, AbstractDigestAuthHandler
27 self.assertRaises(ValueError, urllib2.urlopen, 'bogus url')
30 fname = os.path.abspath(urllib2.__file__).replace(os.sep, '/')
44 f = urllib2.urlopen(file_url)
55 self.assertEqual(urllib2.parse_http_list(string), list)
61 urllib2.urlopen(
362 raise urllib2.URLError("blah")
411 class MockHTTPHandler(urllib2.BaseHandler):
437 class MockHTTPSHandler(urllib2.AbstractHTTPHandler):
442 urllib2.AbstractHTTPHandler.__init__(self)
477 from urllib2 import URLError
485 o.add_handler(urllib2.UnknownHandler())
543 self.assertRaises(urllib2.URLError, o.open, req)
631 class NullFTPHandler(urllib2.FTPHandler):
683 h = urllib2.FileHandler()
741 self.assertRaises(urllib2.URLError,
746 h = urllib2.FileHandler()
767 except (urllib2.URLError, OSError):
776 h = urllib2.AbstractHTTPHandler()
806 self.assertRaises(urllib2.URLError, h.do_open, http, req)
839 h = urllib2.AbstractHTTPHandler()
866 h = urllib2.AbstractHTTPHandler()
882 h = urllib2.HTTPErrorProcessor()
908 h = urllib2.HTTPCookieProcessor(cj)
924 h = urllib2.HTTPRedirectHandler()
940 except urllib2.HTTPError:
978 except urllib2.HTTPError:
980 self.assertEqual(count, urllib2.HTTPRedirectHandler.max_repeats)
990 except urllib2.HTTPError:
992 urllib2.HTTPRedirectHandler.max_redirections)
999 h = urllib2.HTTPRedirectHandler()
1006 self.assertRaises(urllib2.HTTPError, h.http_error_302,
1025 hdeh = urllib2.HTTPDefaultErrorHandler()
1026 hrh = urllib2.HTTPRedirectHandler()
1027 cp = urllib2.HTTPCookieProcessor(cj)
1035 hdeh = urllib2.HTTPDefaultErrorHandler()
1036 hrh = urllib2.HTTPRedirectHandler()
1054 fp = urllib2.urlopen("http://python.org/path")
1059 ph = urllib2.ProxyHandler(dict(http="proxy.example.com:3128"))
1077 ph = urllib2.ProxyHandler(dict(http="proxy.example.com"))
1092 ph = urllib2.ProxyHandler(dict(https='proxy.example.com:3128'))
1107 ph = urllib2.ProxyHandler(dict(https='proxy.example.com:3128'))
1131 auth_handler = urllib2.HTTPBasicAuthHandler(password_manager)
1150 auth_handler = urllib2.HTTPBasicAuthHandler(password_manager)
1167 ph = urllib2.ProxyHandler(dict(http="proxy.example.com:3128"))
1170 auth_handler = urllib2.ProxyBasicAuthHandler(password_manager)
1197 class TestDigestAuthHandler(urllib2.HTTPDigestAuthHandler):
1200 urllib2.HTTPDigestAuthHandler.http_error_401(self,
1202 class TestBasicAuthHandler(urllib2.HTTPBasicAuthHandler):
1205 urllib2.HTTPBasicAuthHandler.http_error_401(self,
1268 class MyHTTPHandler(urllib2.HTTPHandler): pass
1269 class FooHandler(urllib2.BaseHandler):
1271 class BarHandler(urllib2.BaseHandler):
1274 build_opener = urllib2.build_opener
1292 self.opener_has_handler(o, urllib2.HTTPHandler)
1293 o = build_opener(urllib2.HTTPHandler)
1294 self.opener_has_handler(o, urllib2.HTTPHandler)
1295 o = build_opener(urllib2.HTTPHandler())
1296 self.opener_has_handler(o, urllib2.HTTPHandler)
1299 class MyOtherHTTPHandler(urllib2.HTTPHandler): pass
1324 self.get = urllib2.Request("http://www.python.org/~jeremy/")
1325 self.post = urllib2.Request("http://www.python.org/~jeremy/",
1346 req = urllib2.Request("http://www.python.org/")
1356 req = urllib2.Request("http://www.%70ython.org/")
1401 err = urllib2.HTTPError(msg='something bad happened', url=None,
1416 test_support.run_doctest(urllib2, verbose)