[issue23360] Content-Type when sending data with urlopen()

2021-12-05 Thread Irit Katriel


Change by Irit Katriel :


--
stage: patch review -> resolved
status: pending -> closed

___
Python tracker 

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



[issue23360] Content-Type when sending data with urlopen()

2021-11-27 Thread Irit Katriel


Irit Katriel  added the comment:

Martin, I think you fixed this in 

https://github.com/python/cpython/commit/3c0d0baf2badfad7deb346d1043f7d83bb92691f#diff-533bd604631e0e26ce55dfa75a878788f3c4d7d7ccb3bbaeaa2ee2a9c956ffe8

--
nosy: +iritkatriel
resolution:  -> out of date
status: open -> pending

___
Python tracker 

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



[issue23360] Content-Type when sending data with urlopen()

2016-06-17 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +orsenthil, r.david.murray

___
Python tracker 

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



[issue23360] Content-Type when sending data with urlopen()

2016-06-16 Thread Martin Panter

Martin Panter added the comment:

Fixed conflicts with recent changes

--
versions: +Python 2.7 -Python 3.4
Added file: http://bugs.python.org/file43428/non-urlencoded.6.patch

___
Python tracker 

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



[issue23360] Content-Type when sending data with urlopen()

2015-11-06 Thread Martin Panter

Martin Panter added the comment:

Spotted a docstring that needed updating

--
Added file: http://bugs.python.org/file40969/non-urlencoded.5.patch

___
Python tracker 

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



[issue23360] Content-Type when sending data with urlopen()

2015-11-06 Thread Martin Panter

Martin Panter added the comment:

Patch 4 is just updated to avoid conflicts with the current code. Changes are 
the same.

--
versions: +Python 3.6
Added file: http://bugs.python.org/file40968/non-urlencoded.4.patch

___
Python tracker 

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



[issue23360] Content-Type when sending data with urlopen()

2015-03-31 Thread Demian Brecht

Changes by Demian Brecht :


--
nosy: +demian.brecht

___
Python tracker 

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



[issue23360] Content-Type when sending data with urlopen()

2015-03-31 Thread Martin Panter

Martin Panter added the comment:

I think we should avoid mentioning bytes-like objects until Issue 23740 
(http.client support), Issue 23756 (clarify definition), and/or 
SSLSocket.sendall() support are sorted out.

Changes in non-urlencoded.3.patch:
* Removed iterable object as direct urlopen() argument, since that would 
require a custom Content-Length and therefore a custom Request object
* Removed Content-Type discussion from urlopen() for similar reasons
* Added iterable object to Request constructor (already tested)
* Clarified default Content-Type whenever data is not None
* Added a test for default Content-Type with iterable object

--
stage:  -> patch review
versions: +Python 3.5
Added file: http://bugs.python.org/file38758/non-urlencoded.3.patch

___
Python tracker 

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



[issue23360] Content-Type when sending data with urlopen()

2015-03-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The documentation looks contradictory. "The *data* argument must be", but "The 
*data* argument may also be". "must be a bytes object", but "If *data* is a 
buffer".

Why not write just "The data argument must be a bytes-like object, an iterable 
of bytes-like objects, or None"? It doesn't depend if url is a string or a 
Request object.

AFAIK the data argument of Request can be an iterable of bytes-like objects in 
additional to a bytes-like object or None.

The note about the application/x-www-form-urlencoded format is applied not only 
to a bytes object, but to an iterable of bytes-like objects too. I.e. to any 
acceptable value except None.

--

___
Python tracker 

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



[issue23360] Content-Type when sending data with urlopen()

2015-03-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue23360] Content-Type when sending data with urlopen()

2015-02-01 Thread Martin Panter

Martin Panter added the comment:

Updated patch to explain that a Request object is generated internally for 
urlopen(data=...), and added a test to confirm. Also removed some confusing 
dead code.

--
Added file: http://bugs.python.org/file37972/non-urlencoded.2.patch

___
Python tracker 

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



[issue23360] Content-Type when sending data with urlopen()

2015-02-01 Thread Martin Panter

New submission from Martin Panter:

Currently the documentation gives the impression that the “data” parameter to 
Request() has to be in the application/x-www-form-urlencoded format. However I 
suspect that you can override the type by supplying a Content-Type header, and 
I would like to document this; see uploaded patch.

I noticed that test_urllib2.HandlerTests.test_http() already seems to test the 
default Content-Type and a custom Content-Type with a Request() object, 
although I did not see a test for the default Content-Type when supplying 
“data” directly to urlopen().

Also I understand the “charset” parameter on application/x-www-form-urlencoded 
is not standardized. Would it correspond to the encoding of the %XX codes from 
urlencode(), which is typically UTF-8, not Latin-1? Or would it correspond to 
the subsequent string-to-bytes encoding stage, which could just be ASCII since 
non-ASCII characters are already encoded? Maybe it would be best to drop the 
advice to set a “charset” parameter. It was added for Issue 11082.

--
assignee: docs@python
components: Documentation
files: non-urlencoded.patch
keywords: patch
messages: 235166
nosy: docs@python, vadmium
priority: normal
severity: normal
status: open
title: Content-Type when sending data with urlopen()
versions: Python 3.4
Added file: http://bugs.python.org/file37959/non-urlencoded.patch

___
Python tracker 

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