Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http.client.REQUEST_HEADER_FIELDS_TOO_LARGE renamed in 3.5 #67630

Closed
vadmium opened this issue Feb 11, 2015 · 10 comments
Closed

http.client.REQUEST_HEADER_FIELDS_TOO_LARGE renamed in 3.5 #67630

vadmium opened this issue Feb 11, 2015 · 10 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@vadmium
Copy link
Member

vadmium commented Feb 11, 2015

BPO 23442
Nosy @berkerpeksag, @vadmium, @serhiy-storchaka, @demianbrecht
Files
  • issue23442.patch
  • httpstatus_tests.diff
  • issue23442_1.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2015-02-20.12:58:54.007>
    created_at = <Date 2015-02-11.11:46:11.722>
    labels = ['type-bug', 'library']
    title = 'http.client.REQUEST_HEADER_FIELDS_TOO_LARGE renamed in 3.5'
    updated_at = <Date 2015-02-20.12:58:54.006>
    user = 'https://github.com/vadmium'

    bugs.python.org fields:

    activity = <Date 2015-02-20.12:58:54.006>
    actor = 'berker.peksag'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-02-20.12:58:54.007>
    closer = 'berker.peksag'
    components = ['Library (Lib)']
    creation = <Date 2015-02-11.11:46:11.722>
    creator = 'martin.panter'
    dependencies = []
    files = ['38112', '38119', '38122']
    hgrepos = []
    issue_num = 23442
    keywords = ['patch']
    message_count = 10.0
    messages = ['235737', '235769', '235845', '235856', '235861', '235862', '235863', '235866', '236277', '236278']
    nosy_count = 5.0
    nosy_names = ['python-dev', 'berker.peksag', 'martin.panter', 'serhiy.storchaka', 'demian.brecht']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue23442'
    versions = ['Python 3.5']

    @vadmium
    Copy link
    Member Author

    vadmium commented Feb 11, 2015

    This is a regression caused by the new HTTPStatus enum from bpo-21793. RFC 6585 uses the plural “Fields”, so maybe the new enum symbol needs renaming.

    $ python3.4
    Python 3.4.2 (default, Oct  8 2014, 13:44:52) 
    [GCC 4.9.1 20140903 (prerelease)] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import http.client
    >>> http.client.REQUEST_HEADER_FIELDS_TOO_LARGE
    431
    >>> http.client.REQUEST_HEADER_FIELD_TOO_LARGE
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: 'module' object has no attribute 'REQUEST_HEADER_FIELD_TOO_LARGE'
    >>> 
    $ ./python
    Python 3.5.0a0 (qbase qtip simple-http-testing.patch tip:f3fadbfb10ba, Feb 11 2015, 07:18:07) 
    [GCC 4.9.1] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import http.client
    >>> http.client.REQUEST_HEADER_FIELDS_TOO_LARGE
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: module 'http.client' has no attribute 'REQUEST_HEADER_FIELDS_TOO_LARGE'
    >>> http.client.REQUEST_HEADER_FIELD_TOO_LARGE
    <HTTPStatus.REQUEST_HEADER_FIELD_TOO_LARGE: 431>

    @vadmium vadmium added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Feb 11, 2015
    @demianbrecht
    Copy link
    Mannequin

    demianbrecht mannequin commented Feb 11, 2015

    Thanks for the catch Martin, the field should indeed be updated to be
    plural. I'll try to get a patch for this later today unless someone else
    beats me to it

    @demianbrecht
    Copy link
    Mannequin

    demianbrecht mannequin commented Feb 12, 2015

    The attached patch fixes the name

    @vadmium
    Copy link
    Member Author

    vadmium commented Feb 12, 2015

    Thanks. Confirming the patch fixes the problem for me, so should be comitted. I wonder if a test case would be good too though.

    @berkerpeksag
    Copy link
    Member

    I found another regression: In Python 3.4, 416 is REQUESTED_RANGE_NOT_SATISFIABLE, but REQUEST_RANGE_NOT_SATISFIABLE in 3.5.

    @berkerpeksag
    Copy link
    Member

    Here is a test case.

    ======================================================================
    FAIL: test_client_constants (test.test_httplib.OfflineTest) (constant='REQUESTED_RANGE_NOT_SATISFIABLE')
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/berker/projects/cpython/default/Lib/test/test_httplib.py", line 985, in test_client_constants
        self.assertTrue(hasattr(client, const))
    AssertionError: False is not true

    ======================================================================
    FAIL: test_client_constants (test.test_httplib.OfflineTest) (constant='REQUEST_HEADER_FIELDS_TOO_LARGE')
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/berker/projects/cpython/default/Lib/test/test_httplib.py", line 985, in test_client_constants
        self.assertTrue(hasattr(client, const))
    AssertionError: False is not true

    @demianbrecht
    Copy link
    Mannequin

    demianbrecht mannequin commented Feb 12, 2015

    Thanks for the test Berker, I'll put a patch together with the changes
    later this afternoon.

    On 2015-02-12 2:27 PM, Berker Peksag wrote:

    Berker Peksag added the comment:

    Here is a test case.

    ======================================================================
    FAIL: test_client_constants (test.test_httplib.OfflineTest) (constant='REQUESTED_RANGE_NOT_SATISFIABLE')
    ----------------------------------------------------------------------

    > Traceback (most recent call last):
    >   File "/home/berker/projects/cpython/default/Lib/test/test_httplib.py", line 985, in test_client_constants
    >     self.assertTrue(hasattr(client, const))
    > AssertionError: False is not true
    > 
    > 

    ======================================================================

    FAIL: test_client_constants (test.test_httplib.OfflineTest) (constant='REQUEST_HEADER_FIELDS_TOO_LARGE')
    ----------------------------------------------------------------------

    > Traceback (most recent call last):
    >   File "/home/berker/projects/cpython/default/Lib/test/test_httplib.py", line 985, in test_client_constants
    >     self.assertTrue(hasattr(client, const))
    > AssertionError: False is not true
    > 
    > 

    Added file: http://bugs.python.org/file38119/httpstatus_tests.diff


    Python tracker <report@bugs.python.org>
    <http://bugs.python.org/issue23442\>


    @demianbrecht
    Copy link
    Mannequin

    demianbrecht mannequin commented Feb 13, 2015

    I've attached a patch with fixes for both cases and the tests added by
    Berker. Thanks guys.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Feb 20, 2015

    New changeset 52d37efaf939 by Berker Peksag in branch 'default':
    Issue bpo-23442: Rename two member names to stay backward compatible
    https://hg.python.org/cpython/rev/52d37efaf939

    @berkerpeksag
    Copy link
    Member

    Fixed. Thanks to both of you :)

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants