[issue25576] Remove “Content-Type: application/x-www-form-urlencoded; charset” advice

2015-11-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 16fec577fd8b by Martin Panter in branch '3.4':
Issue #25576: Remove application/x-www-form-urlencoded charset advice
https://hg.python.org/cpython/rev/16fec577fd8b

New changeset 95ae5262d27c by Martin Panter in branch '3.5':
Issue #25576: Merge www-form-urlencoded doc from 3.4 into 3.5
https://hg.python.org/cpython/rev/95ae5262d27c

New changeset d52521d13a64 by Martin Panter in branch 'default':
Issue #25576: Merge www-form-urlencoded doc from 3.5
https://hg.python.org/cpython/rev/d52521d13a64

New changeset 671429cc1d96 by Martin Panter in branch 'default':
Issue #25576: Apply fix to new urlopen() doc string
https://hg.python.org/cpython/rev/671429cc1d96

--
nosy: +python-dev

___
Python tracker 

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



[issue25576] Remove “Content-Type: application/x-www-form-urlencoded; charset” advice

2015-11-24 Thread Martin Panter

Changes by Martin Panter :


--
resolution:  -> fixed
stage: patch review -> 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



[issue25576] Remove “Content-Type: application/x-www-form-urlencoded; charset” advice

2015-11-08 Thread R. David Murray

R. David Murray added the comment:

OK, I'll accept that as authoritative :)

One very minor comment in the review, otherwise looks good to me.

--

___
Python tracker 

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



[issue25576] Remove “Content-Type: application/x-www-form-urlencoded; charset” advice

2015-11-08 Thread Martin Panter

Martin Panter added the comment:

The second version of the patch changes some more examples in the how-to to 
data.encode("ascii"). I’ll leave this open for a bit in case Senthil is around 
and wants to comment (seeing as he added the text I am removing).

--
Added file: http://bugs.python.org/file40983/urlencoded-charset.2.patch

___
Python tracker 

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



[issue25576] Remove “Content-Type: application/x-www-form-urlencoded; charset” advice

2015-11-08 Thread Martin Panter

Martin Panter added the comment:

I think the server bugs referenced by the Mozilla bug are mainly about servers 
that do not recognize the content type at all, due the the presence of any 
charset parameter. They probably do something like “if headers['Content-Type'] 
== 'application/x-www-form-urlencoded' ” without checking for parameters first. 
So it wouldn’t matter if it was charset=latin-1 or charset=utf-8.

A couple comments in the Mozilla bug say that including “charset” is specified 
by a HTTP standard, but I suspect this may be a mistake. Perhaps this is the 
best evidence for my argument, from 
:

'''
Parameters on the “application/x-www-form-urlencoded” MIME type are ignored. In 
particular, this MIME type does not support the “charset” parameter.
'''

--

___
Python tracker 

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



[issue25576] Remove “Content-Type: application/x-www-form-urlencoded; charset” advice

2015-11-07 Thread Martin Panter

New submission from Martin Panter:

I understand using a “charset” parameter with “Content-Type: 
application/x-www-form-urlencoded” is not standardized. Since Issue 11082, the 
documentation advises to use it, but I propose to remove this advice.

HTML 5 mentions setting a _charset_ parameter, and mentions decoding with a 
default of UTF-8 (not Latin-1!), but does not mention any Content-Type 
parameters.

There seems to be confusion about what encoding it actually represents. 
According to , Mozilla 
briefly set this “charset” parameter a long time ago, but it would have 
corresponded to the urlencode(encoding=...) argument. The Python documentation 
currently suggests calling data.encode("utf-8"), which is misleading, because 
the urlencode() output is already guaranteed to be ASCII text. Any non-ASCII 
characters and bytes will already be character-encoded and percent-encoded by 
urlencode(). So I also propose to change the examples to data.encode("ascii").

--
assignee: docs@python
components: Documentation
files: urlencoded-charset.patch
keywords: patch
messages: 254263
nosy: docs@python, martin.panter, orsenthil
priority: normal
severity: normal
stage: patch review
status: open
title: Remove “Content-Type: application/x-www-form-urlencoded; charset” advice
versions: Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40970/urlencoded-charset.patch

___
Python tracker 

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



[issue25576] Remove “Content-Type: application/x-www-form-urlencoded; charset” advice

2015-11-07 Thread R. David Murray

R. David Murray added the comment:

Although I didn't read through the whole thing, the mozilla bug discussion 
indicates this is the correct way to specify the charset, it's just that there 
was lots of buggy software that didn't handle setting it to latin-1.  Is the 
same true for setting it to utf-8?

Agreed about the encode call.

--
nosy: +r.david.murray

___
Python tracker 

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