Skip to content

Restore deprecated status code aliases - #1135

Merged
Kludex merged 1 commit into
mainfrom
fix-deprecated-status-code-aliases
Aug 13, 2026
Merged

Kludex merged 1 commit into
mainfrom
fix-deprecated-status-code-aliases

Conversation

@Kludex

@Kludex Kludex commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Restore the pre-RFC 9110 status-code names as real enum aliases while retaining deprecation warnings for uppercase attribute access.

This restores compatibility for:

  • enum by-name lookup, such as codes["REQUEST_ENTITY_TOO_LARGE"]
  • membership in codes.__members__
  • lowercase requests-style attributes, such as codes.request_entity_too_large

Tests now cover all supported deprecated-alias access patterns.

Tests

  • uv run pytest tests/httpx2/test_status_codes.py
  • uv run ruff check src/httpx2/httpx2/_status_codes.py tests/httpx2/test_status_codes.py
  • uv run ruff format --check src/httpx2/httpx2/_status_codes.py tests/httpx2/test_status_codes.py
  • uv run mypy src/httpx2/httpx2/_status_codes.py tests/httpx2/test_status_codes.py

Checklist

  • I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • Documentation is not affected by this compatibility fix.

Review in cubic

@github-actions

Copy link
Copy Markdown

@codspeed

codspeed Bot commented Aug 13, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 17 untouched benchmarks
⏩ 7 skipped benchmarks1


Comparing fix-deprecated-status-code-aliases (43b7aa7) with main (6f38ddf)

Open in CodSpeed

Footnotes

  1. 7 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@Kludex
Kludex merged commit 8a6f370 into main Aug 13, 2026
19 checks passed
@Kludex
Kludex deleted the fix-deprecated-status-code-aliases branch August 13, 2026 14:49
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Aug 25, 2026
## 2.12.0 (August 18th, 2026)

### Changed

* Use `backports.zstd` for Zstandard decoding on Python 3.13 and earlier.
  ([#1146](pydantic/httpx2#1146))

### Fixed

* Bound peak memory while streaming compressed responses and close response streams when decoding fails.
  ([#1126](pydantic/httpx2#1126))

## 2.11.0 (August 18th, 2026)

### Added

* Add the public `Origin` value object and `URL.origin` property for normalized,
  hashable origin comparisons. ([#1134](pydantic/httpx2#1134))

### Changed

* Require Brotli 1.2.0 or later for the `brotli` extra. ([#1141](pydantic/httpx2#1141))

### Fixed

* Restore deprecated status code aliases. ([#1135](pydantic/httpx2#1135))
* Extract HTTP/2 release notes from changelog headings correctly. ([#1136](pydantic/httpx2#1136))
* Respect explicit `Transfer-Encoding` headers and expose buffered request body lengths to WSGI applications.
  ([#1137](pydantic/httpx2#1137))
* Validate multipart part header names and values before serialization.
  ([#1142](pydantic/httpx2#1142))
tsutsui pushed a commit to tsutsui/pkgsrc that referenced this pull request Oct 17, 2026
## 2.12.0 (August 18th, 2026)

### Changed

* Use `backports.zstd` for Zstandard decoding on Python 3.13 and earlier.
  ([#1146](pydantic/httpx2#1146))

### Fixed

* Bound peak memory while streaming compressed responses and close response streams when decoding fails.
  ([#1126](pydantic/httpx2#1126))

## 2.11.0 (August 18th, 2026)

### Added

* Add the public `Origin` value object and `URL.origin` property for normalized,
  hashable origin comparisons. ([#1134](pydantic/httpx2#1134))

### Changed

* Require Brotli 1.2.0 or later for the `brotli` extra. ([#1141](pydantic/httpx2#1141))

### Fixed

* Restore deprecated status code aliases. ([#1135](pydantic/httpx2#1135))
* Extract HTTP/2 release notes from changelog headings correctly. ([#1136](pydantic/httpx2#1136))
* Respect explicit `Transfer-Encoding` headers and expose buffered request body lengths to WSGI applications.
  ([#1137](pydantic/httpx2#1137))
* Validate multipart part header names and values before serialization.
  ([#1142](pydantic/httpx2#1142))

This branch was previously deployed

1 inactive deployment
cloudflare — 43b7aa74 Deployed Aug 13, 2026 by Kludex via Docs preview (Cloudflare) #697
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant