classification
Title: http.client.REQUEST_HEADER_FIELDS_TOO_LARGE renamed in 3.5
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: berker.peksag, demian.brecht, martin.panter, python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2015-02-11 11:46 by martin.panter, last changed 2015-02-20 12:58 by berker.peksag. This issue is now closed.

Files
File name Uploaded Description Edit
issue23442.patch demian.brecht, 2015-02-12 16:34 review
httpstatus_tests.diff berker.peksag, 2015-02-12 22:27 review
issue23442_1.patch demian.brecht, 2015-02-13 00:49 review
Messages (10)
msg235737 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-02-11 11:46
This is a regression caused by the new HTTPStatus enum from Issue 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>
msg235769 - (view) Author: Demian Brecht (demian.brecht) * (Python triager) Date: 2015-02-11 21:06
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
msg235845 - (view) Author: Demian Brecht (demian.brecht) * (Python triager) Date: 2015-02-12 16:34
The attached patch fixes the name
msg235856 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-02-12 21:57
Thanks. Confirming the patch fixes the problem for me, so should be comitted. I wonder if a test case would be good too though.
msg235861 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-02-12 22:23
I found another regression: In Python 3.4, 416 is REQUESTED_RANGE_NOT_SATISFIABLE, but REQUEST_RANGE_NOT_SATISFIABLE in 3.5.
msg235862 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-02-12 22:27
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
msg235863 - (view) Author: Demian Brecht (demian.brecht) * (Python triager) Date: 2015-02-12 22:35
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>
> _______________________________________
>
msg235866 - (view) Author: Demian Brecht (demian.brecht) * (Python triager) Date: 2015-02-13 00:49
I've attached a patch with fixes for both cases and the tests added by
Berker. Thanks guys.
msg236277 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-02-20 12:56
New changeset 52d37efaf939 by Berker Peksag in branch 'default':
Issue #23442: Rename two member names to stay backward compatible
https://hg.python.org/cpython/rev/52d37efaf939
msg236278 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-02-20 12:58
Fixed. Thanks to both of you :)
History
Date User Action Args
2015-02-20 12:58:54berker.peksagsetstatus: open -> closed
resolution: fixed
messages: + msg236278

stage: patch review -> resolved
2015-02-20 12:56:37python-devsetnosy: + python-dev
messages: + msg236277
2015-02-13 00:49:49demian.brechtsetfiles: + issue23442_1.patch

messages: + msg235866
2015-02-12 22:35:17demian.brechtsetmessages: + msg235863
2015-02-12 22:27:17berker.peksagsetfiles: + httpstatus_tests.diff

messages: + msg235862
2015-02-12 22:23:13berker.peksagsetnosy: + berker.peksag

messages: + msg235861
stage: patch review
2015-02-12 21:57:09martin.pantersetmessages: + msg235856
2015-02-12 16:34:13demian.brechtsetfiles: + issue23442.patch
keywords: + patch
messages: + msg235845
2015-02-11 21:06:45demian.brechtsetmessages: + msg235769
2015-02-11 12:37:58berker.peksagsetnosy: + serhiy.storchaka
2015-02-11 11:46:11martin.pantercreate