timeout argument to urllib.request.urlopen is Optional (#3487)

The docs (https://docs.python.org/3/library/urllib.request.html#urllib.request.urlopen) aren't very precise about this, but passing `None` seems to work in practice.
This commit is contained in:
Jelle Zijlstra
2019-11-24 03:51:33 -08:00
committed by Sebastian Rittau
parent a89f883878
commit 1f0dc6ee05

View File

@@ -21,7 +21,7 @@ class _HTTPResponse(HTTPResponse):
def urlopen(
url: Union[str, Request], data: Optional[bytes] = ...,
timeout: float = ..., *, cafile: Optional[str] = ...,
timeout: Optional[float] = ..., *, cafile: Optional[str] = ...,
capath: Optional[str] = ..., cadefault: bool = ...,
context: Optional[ssl.SSLContext] = ...
) -> _UrlopenRet: ...
@@ -71,7 +71,7 @@ class OpenerDirector:
addheaders: List[Tuple[str, str]]
def add_handler(self, handler: BaseHandler) -> None: ...
def open(self, url: Union[str, Request], data: Optional[bytes] = ...,
timeout: float = ...) -> _UrlopenRet: ...
timeout: Optional[float] = ...) -> _UrlopenRet: ...
def error(self, proto: str, *args: Any) -> _UrlopenRet: ...