Skip to content

Commit 464b71c

Browse files
authored
Added url: str to http.client.HTTPResponse (#10497)
1 parent 33588c7 commit 464b71c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

stdlib/http/client.pyi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ class HTTPResponse(io.BufferedIOBase, BinaryIO): # type: ignore[misc] # incomp
115115
chunk_left: int | None
116116
length: int | None
117117
will_close: bool
118+
# url is set on instances of the class in urllib.request.AbstractHTTPHandler.do_open
119+
# to match urllib.response.addinfourl's interface.
120+
# It's not set in HTTPResponse.__init__ or any other method on the class
121+
url: str
118122
def __init__(self, sock: socket, debuglevel: int = 0, method: str | None = None, url: str | None = None) -> None: ...
119123
def peek(self, n: int = -1) -> bytes: ...
120124
def read(self, amt: int | None = None) -> bytes: ...

0 commit comments

Comments
 (0)