From 8bd744a38f39ed13c4af057644b0fd8148422f87 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Fri, 3 May 2019 14:44:56 -0400 Subject: [PATCH] fix type of msg argument to HTTPRedirectHandler.redirect_request (#2949) It's not really documented (https://docs.python.org/3/library/urllib.request.html#urllib.request.HTTPRedirectHandler.redirect_request), but logically a message is a str, and reading the code for the stdlib confirms that it's intended to be a str. --- stdlib/3/urllib/request.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/3/urllib/request.pyi b/stdlib/3/urllib/request.pyi index fb6fc6d44..a1a556813 100644 --- a/stdlib/3/urllib/request.pyi +++ b/stdlib/3/urllib/request.pyi @@ -85,7 +85,7 @@ class BaseHandler: class HTTPDefaultErrorHandler(BaseHandler): ... class HTTPRedirectHandler(BaseHandler): - def redirect_request(self, req: Request, fp: IO[str], code: int, msg: int, + def redirect_request(self, req: Request, fp: IO[str], code: int, msg: str, hdrs: Mapping[str, str], newurl: str) -> Optional[Request]: ... def http_error_301(self, req: Request, fp: IO[str], code: int, msg: int,