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
Comments
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> |
Thanks for the catch Martin, the field should indeed be updated to be |
The attached patch fixes the name |
Thanks. Confirming the patch fixes the problem for me, so should be comitted. I wonder if a test case would be good too though. |
I found another regression: In Python 3.4, 416 is REQUESTED_RANGE_NOT_SATISFIABLE, but REQUEST_RANGE_NOT_SATISFIABLE in 3.5. |
Here is a test case. ====================================================================== 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 ====================================================================== 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 |
Thanks for the test Berker, I'll put a patch together with the changes On 2015-02-12 2:27 PM, Berker Peksag wrote:
> 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
>
> ======================================================================
> 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
>
>
|
I've attached a patch with fixes for both cases and the tests added by |
New changeset 52d37efaf939 by Berker Peksag in branch 'default': |
Fixed. Thanks to both of you :) |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: