Deprecations via warnings don’t work for Python libraries

AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.

Why it matters

Python library maintainers cannot rely on DeprecationWarning to actually remove old APIs, because downstream users silently ignore warnings and breaking removals get reverted, as urllib3 just demonstrated.

Read this as

A Python library called urllib3 removed some old, outdated functions in version 2.6.0, released on 5 December 2025. Those functions had been marked as 'deprecated', meaning users were warned they would go away, since April 2023. But other popular software, including the Kubernetes client, still relied on them and had not updated. Within days urllib3 had to put the old functions back, showing that relying on warnings alone to retire old code does not work.

urllib3, a widely used Python networking library, deleted two legacy methods in version 2.6.0 on 5 December 2025 after warning about them since April 2023. Major dependents such as kubernetes-client and fastly-py had never acted on those warnings, forcing an emergency rollback in version 2.6.1 on 8 December. The lesson for engineering leaders: deprecation warnings that are not surfaced in test suites or upgrade plans do not reduce risk, they hide it.

urllib3 2.6.0 (5 December 2025) removed HTTPResponse.getheaders() and HTTPResponse.getheader(name, default), deprecated since v2.0.0 in April 2023. Downstream breakage in kubernetes-client and fastly-py forced their restoration in 2.6.1 (8 December 2025). Seth Larson concludes DeprecationWarning does not work for Python library deprecations. James Bennett recommends running test suites with -Wonce::DeprecationWarning, 'warn once per Python process', so warnings surface without spam.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

urllib3 kubernetes-client fastly-py DeprecationWarning HTTPResponse.getheaders() Python

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading