[urllib] Deprecate addinfourl methods (#15291)

This commit is contained in:
Semyon Moroz
2026-01-16 07:41:35 +00:00
committed by GitHub
parent 7c0301e620
commit ba6dbf4573
+6 -1
View File
@@ -4,6 +4,7 @@ from collections.abc import Callable, Iterable
from email.message import Message
from types import TracebackType
from typing import IO, Any
from typing_extensions import deprecated
__all__ = ["addbase", "addclosehook", "addinfo", "addinfourl"]
@@ -32,9 +33,13 @@ class addinfo(addbase):
class addinfourl(addinfo):
url: str
code: int | None
code: int | None # Deprecated since Python 3.9. Use `addinfourl.status` attribute instead.
@property
def status(self) -> int | None: ...
def __init__(self, fp: IO[bytes], headers: Message, url: str, code: int | None = None) -> None: ...
@deprecated("Deprecated since Python 3.9. Use `addinfourl.url` attribute instead.")
def geturl(self) -> str: ...
@deprecated("Deprecated since Python 3.9. Use `addinfourl.headers` attribute instead.")
def info(self) -> Message: ...
@deprecated("Deprecated since Python 3.9. Use `addinfourl.status` attribute instead.")
def getcode(self) -> int | None: ...