[issue26123] http.client status code constants incompatible with Python 3.4

2017-10-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Thank you Sebastian.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26123] http.client status code constants incompatible with Python 3.4

2017-10-23 Thread Sebastian Rittau

Sebastian Rittau  added the comment:

I take the liberty of closing this "wont fix". Changing the behaviour would 
most likely do more harm than good. If one of the maintainers disagrees, please 
reopen. :)

--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26123] http.client status code constants incompatible with Python 3.4

2016-01-15 Thread Sebastian Rittau

New submission from Sebastian Rittau:

The HTTP status code constants in Python 3.5 http.client are not compatible 
with the constants in Python 3.4, since the str() behaviour is different. This 
breaks code: 

srittau@moby:~$ python3.5
Python 3.5.1+ (default, Jan 13 2016, 15:09:18) 
[GCC 5.3.1 20160101] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import http.client
>>> str(http.client.OK)
'HTTPStatus.OK'

vs:

rittau@moby:~$ python3.4
Python 3.4.4 (default, Jan  5 2016, 15:35:18) 
[GCC 5.3.1 20160101] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import http.client
>>> str(http.client.OK)
'200'

--
components: Library (Lib)
messages: 258291
nosy: srittau
priority: normal
severity: normal
status: open
title: http.client status code constants incompatible with Python 3.4
versions: Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26123] http.client status code constants incompatible with Python 3.4

2016-01-15 Thread SilentGhost

Changes by SilentGhost :


--
keywords: +3.5regression
nosy: +serhiy.storchaka
type:  -> behavior
versions: +Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26123] http.client status code constants incompatible with Python 3.4

2016-01-15 Thread Sebastian Rittau

Sebastian Rittau added the comment:

It is no doubt that is easy to work around. Once I found the problem it took 
about five minutes to fix it and roll a new release. And of course for Python 
3.5+ code it is better to use the enum http.HTTPStatus directly (I actually 
like that enum a lot). But this breaks existing code that should not break. It 
might be too late to change now, though.

As a side note, I would also have preferred str(HTTPStatus.OK) to return "OK" 
or "200" - the latter would mirror default format behaviour - instead of 
"HTTPStatus.OK", but this may be too late as well.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26123] http.client status code constants incompatible with Python 3.4

2016-01-15 Thread Ethan Furman

Changes by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26123] http.client status code constants incompatible with Python 3.4

2016-01-15 Thread Ethan Furman

Ethan Furman added the comment:

These changes were made in issue21793.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26123] http.client status code constants incompatible with Python 3.4

2016-01-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, this a side effect of using more human-friendly enums. This is not a 
problem if string representation is used in formatting human-readable messages, 
but if you need numerical representation, you could use str(int(code)), '%d' % 
code or '{:d}'.format(code).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26123] http.client status code constants incompatible with Python 3.4

2016-01-15 Thread Martin Panter

Martin Panter added the comment:

This affected the HTTP server log messages, discussed from 
 onwards. The first three patches 
proposed changed the HTTPStatus.__str__() implementation, which would have 
avoided the problem in general. But Demian’s final patch made a special case of 
checking for HTTPStatus objects in the logging code instead.

IMO it may have been better to change HTTPStatus.__str__() to use int.__str__() 
at the time.

--
nosy: +martin.panter

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26123] http.client status code constants incompatible with Python 3.4

2016-01-15 Thread Ethan Furman

Ethan Furman added the comment:

Not using Enum's __str__ was discussed (I think during the initial Enum threads 
when PEP435 was being debated) and IIRC Guido was strongly against it as it 
took away half the purpose of using an Enum.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com