8000 Add missing description for codes in `http.HTTPStatus` · Issue #127089 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
Add missing description for codes in http.HTTPStatus #127089
Closed
@donBarbos

Description

@donBarbos

Bug report

Bug description:

We have Enum of 62 HTTP status codes. They stores in http.HTTPStatus class and 14 of them don't have description field.
I think it is not-obvious behavior when calling the description field, one code returns text and another returns an empty string:

import http
assert http.HTTPStatus.PROCESSING.description == ''
assert http.HTTPStatus.OK.description == 'Request fulfilled, document follows'

Path file: ./Lib/http/__init__.py
List of codes with empty description:

    PROCESSING = 102, 'Processing'
    EARLY_HINTS = 103, 'Early Hints'
    MULTI_STATUS = 207, 'Multi-Status'
    ALREADY_REPORTED = 208, 'Already Reported'
    IM_USED = 226, 'IM Used'
    UNPROCESSABLE_CONTENT = 422, 'Unprocessable Content'
    LOCKED = 423, 'Locked'
    FAILED_DEPENDENCY = 424, 'Failed Dependency'
    TOO_EARLY = 425, 'Too Early'
    UPGRADE_REQUIRED = 426, 'Upgrade Required'
    VARIANT_ALSO_NEGOTIATES = 506, 'Variant Also Negotiates'
    INSUFFICIENT_STORAGE = 507, 'Insufficient Storage'
    LOOP_DETECTED = 508, 'Loop Detected'
    NOT_EXTENDED = 510, 'Not Extended'

I am ready to send PR

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Metadata

Metadata

Assignees

Labels

stdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0