Fixes to urllib2 stubs (#154)

This commit is contained in:
Jukka Lehtosalo
2016-04-22 13:19:37 +01:00
parent a8ef40467d
commit 5eaf522cde

View File

@@ -15,8 +15,8 @@ class Request(object):
origin_req_host= ...
unredirected_hdrs = ...
def __init__(self, url: str, data: str, headers: Dict[str, str],
origin_req_host: str, unverifiable: bool) -> None: ...
def __init__(self, url: str, data: str = None, headers: Dict[str, str] = ...,
origin_req_host: str = None, unverifiable: bool = ...) -> None: ...
def __getattr__(self, attr): ...
def get_method(self) -> str: ...
def add_data(self, data) -> None: ...
@@ -33,12 +33,13 @@ class Request(object):
def add_header(self, key: str, val: str) -> None: ...
def add_unredirected_header(self, key: str, val: str) -> None: ...
def has_header(self, header_name: str) -> bool: ...
def get_header(self, header_name: str, default: str) -> str: ...
def get_header(self, header_name: str, default: str = None) -> str: ...
def header_items(self): ...
class OpenerDirector(object): ...
def urlopen(url, data, timeout): ...
def urlopen(url, data=None, timeout=..., cafile=None, capath=None, cadefault=False,
context=None): ...
def install_opener(opener): ...
def build_opener(*handlers): ...
@@ -65,7 +66,7 @@ class HTTPRedirectHandler(BaseHandler):
class ProxyHandler(BaseHandler):
def __init__(self, proxies): ...
def __init__(self, proxies=None): ...
def proxy_open(self, req, proxy, type): ...
class HTTPPasswordMgr:
@@ -78,7 +79,7 @@ class HTTPPasswordMgr:
class HTTPPasswordMgrWithDefaultRealm(HTTPPasswordMgr): ...
class AbstractBasicAuthHandler:
def __init__(self, password_mgr): ...
def __init__(self, password_mgr=None): ...
def reset_retry_count(self): ...
def http_error_auth_reqed(self, authreq, host, req, headers): ...
def retry_http_basic_auth(self, host, req, realm): ...
@@ -92,7 +93,7 @@ class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler):
def http_error_407(self, req, fp, code, msg, headers): ...
class AbstractDigestAuthHandler:
def __init__(self, passwd): ...
def __init__(self, passwd=None): ...
def reset_retry_count(self): ...
def http_error_auth_reqed(self, auth_header, host, req, headers): ...
def retry_http_digest_auth(self, req, auth): ...
@@ -121,11 +122,12 @@ class HTTPHandler(AbstractHTTPHandler):
http_request = AbstractHTTPHandler.do_request_
class HTTPSHandler(AbstractHTTPHandler):
def __init__(self, debuglevel=0, context=None): ...
def https_open(self, req): ...
https_request = AbstractHTTPHandler.do_request_
class HTTPCookieProcessor(BaseHandler):
def __init__(self, cookiejar): ...
def __init__(self, cookiejar=None): ...
def http_request(self, request): ...
def http_response(self, request, response): ...