[issue11082] ValueError: Content-Length should be specified

2012-03-15 Thread Senthil Kumaran
Senthil Kumaran added the comment: I have rewritten some parts of the documentation, explaining the use of charset parameter with Content-Type header. Used the suggestions from the previous patch's review comments too. I see that other parts of the documentation can be improved further, I sh

[issue11082] ValueError: Content-Length should be specified

2012-03-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 057cf78ed576 by Senthil Kumaran in branch '3.2': Explain the use of charset parameter with Content-Type header. Issue11082 http://hg.python.org/cpython/rev/057cf78ed576 New changeset 90e35b91756d by Senthil Kumaran in branch 'default': Explain the

[issue11082] ValueError: Content-Length should be specified

2011-11-08 Thread Ezio Melotti
Ezio Melotti added the comment: I think the information in the patch should go in the urlopen doc, not in urlencode. Adding a note to urlencode that says that the result must be encoded is fine, but all the details about the default encoding and the fact that an extra Content-Type header is

[issue11082] ValueError: Content-Length should be specified

2011-11-08 Thread Senthil Kumaran
Senthil Kumaran added the comment: Here is the docs patch which will help us close the issue. Addressing Eric's last comment - I believe the what's new and News for this issue was added with the feature, this one was Exception msg change. -- Added file: http://bugs.python.org/file2364

[issue11082] ValueError: Content-Length should be specified

2011-11-08 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue11082] ValueError: Content-Length should be specified

2011-03-21 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: -haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue11082] ValueError: Content-Length should be specified

2011-02-26 Thread Éric Araujo
Éric Araujo added the comment: BTW, there was no entry in Misc/NEWS, so this was not in whatsnew/3.2.rst. -- nosy: +eric.araujo ___ Python tracker ___ __

[issue11082] ValueError: Content-Length should be specified

2011-02-11 Thread Georg Brandl
Georg Brandl added the comment: Lowering priority and making a doc issue now that the code change has been made. -- components: +Documentation -Library (Lib) priority: deferred blocker -> normal ___ Python tracker

[issue11082] ValueError: Content-Length should be specified

2011-02-11 Thread Senthil Kumaran
Senthil Kumaran added the comment: Thanks. Committed in r88394. Regarding the encoding information. An explanation of this sort might be helpful. The string can be encoded using ISO-8859-1 which is the default encoding for POST data or the user can also encode using a custom encoding , in w

[issue11082] ValueError: Content-Length should be specified

2011-02-10 Thread Georg Brandl
Georg Brandl added the comment: I still find "user-specified encoding" unclear. This can be addressed at a different time though. Your exception message is missing a space between "bytes" and "or"; otherwise this is ok to commit. -- ___ Python tr

[issue11082] ValueError: Content-Length should be specified

2011-02-10 Thread Senthil Kumaran
Senthil Kumaran added the comment: patch with Docs :ref: to proper section. -- Added file: http://bugs.python.org/file20741/issue11082-2.diff ___ Python tracker ___

[issue11082] ValueError: Content-Length should be specified

2011-02-10 Thread Senthil Kumaran
Changes by Senthil Kumaran : Removed file: http://bugs.python.org/file20740/Issue11082-2.patch ___ Python tracker ___ ___ Python-bugs-list mai

[issue11082] ValueError: Content-Length should be specified

2011-02-10 Thread Senthil Kumaran
Senthil Kumaran added the comment: Here is the patch with addressing the comments. 1. It should be TypeError instead of ValueError when str is rejected. We introduced ValueError for this release only, so there is no breakage here. 2. Informed the user that string should be encoded to bytes usin

[issue11082] ValueError: Content-Length should be specified

2011-02-10 Thread Georg Brandl
Georg Brandl added the comment: Victor: I don't see an API change here. A ValueError is raised in both cases, and error messages are not part of the API. (And BTW, you may call me Georg.) Senthil: I'd like the documentation change to be a bit more explicit that a string is always returned.

[issue11082] ValueError: Content-Length should be specified

2011-02-10 Thread Senthil Kumaran
Senthil Kumaran added the comment: Victor - It does not change the API. Only that the ValueError message which had a confusing message that "for iterable data of type " is made clear that POST should not be a str. Yes, a TypeError instead of ValueError would be more appropriate here. ---

[issue11082] ValueError: Content-Length should be specified

2011-02-10 Thread STINNER Victor
STINNER Victor added the comment: Georg Brandl: can this fix go into Python 3.2? It changes the API. I like any patch rejecting unicode where unicode is irrevelant (where we don't know how to choose the right encoding). About the patch: you should maybe add a test to ensure that str is reject

[issue11082] ValueError: Content-Length should be specified

2011-02-10 Thread Senthil Kumaran
Senthil Kumaran added the comment: Here is a patch to resolve this issue. Let me know if it okay to commit.(Or feel free to commit too). -- stage: -> patch review Added file: http://bugs.python.org/file20732/issue11082.diff ___ Python tracker

[issue11082] ValueError: Content-Length should be specified

2011-02-10 Thread Senthil Kumaran
Senthil Kumaran added the comment: On Sat, Feb 5, 2011 at 12:33 AM, Georg Brandl wrote: > > Then let us do that. > > Senthil, what about urlencode of bytes values returning a str? > Sorry, the late response. I needed some time to look at this one and I could only do it today. We have been havi

[issue11082] ValueError: Content-Length should be specified

2011-02-04 Thread Georg Brandl
Georg Brandl added the comment: Then let us do that. Senthil, what about urlencode of bytes values returning a str? -- ___ Python tracker ___ __

[issue11082] ValueError: Content-Length should be specified

2011-02-04 Thread Senthil Kumaran
Senthil Kumaran added the comment: For this particular issue, I think, it is good idea to disallow str explicitly, instead of letting it go through the Iterable and raise a ValueError with a different message. -- ___ Python tracker

[issue11082] ValueError: Content-Length should be specified

2011-02-04 Thread William Wu
William Wu added the comment: So, what's the decision to be taken? I'm willing to provide patches (if I need to), but I need to know *the reasonable behaviors*. :) -- ___ Python tracker __

[issue11082] ValueError: Content-Length should be specified

2011-02-02 Thread Georg Brandl
Georg Brandl added the comment: It is also a question whether to disallow str explicitly, instead of letting it go through the Iterable check. -- ___ Python tracker ___ ___

[issue11082] ValueError: Content-Length should be specified

2011-02-02 Thread Georg Brandl
Georg Brandl added the comment: That would seem correct to me. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue11082] ValueError: Content-Length should be specified

2011-02-02 Thread William Wu
William Wu added the comment: If the POST data should be bytes which I also think reasonable, should urllib.parse.urlencode return bytes instead of str? >>> urllib.parse.urlencode({'foo': 'bar'}) 'foo=bar' >>> urllib.parse.urlencode({b'foo': b'bar'}) 'foo=bar' --

[issue11082] ValueError: Content-Length should be specified

2011-02-02 Thread STINNER Victor
STINNER Victor added the comment: Since r70638, the http client encodes unicode to ISO-8859-1: << RFC 2616 says that iso-8859-1 is the default charset for HTTP entity bodies, but we encoded strings using ascii. See http://bugs.python.org/issue5314. Changed docs and code to use iso-8859-1. >>

[issue11082] ValueError: Content-Length should be specified

2011-02-02 Thread Senthil Kumaran
Senthil Kumaran added the comment: The POST data should be bytes. So in the attached test case, instead of request = urllib.request.Request('http://does.not.matter', 'foo=bar') it should be: request = urllib.request.Request('http://does.not.matter', b'foo=bar') And the Content-Length will be

[issue11082] ValueError: Content-Length should be specified

2011-02-02 Thread Georg Brandl
Georg Brandl added the comment: Senthil, could this be a regression of the recent urllib transfer-encoding changes? -- assignee: -> orsenthil nosy: +georg.brandl, orsenthil priority: normal -> deferred blocker ___ Python tracker

[issue11082] ValueError: Content-Length should be specified

2011-01-31 Thread William Wu
Changes by William Wu : Added file: http://bugs.python.org/file20634/urllib_request.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue11082] ValueError: Content-Length should be specified

2011-01-31 Thread William Wu
Changes by William Wu : -- keywords: +patch Added file: http://bugs.python.org/file20633/test_urllib_request.patch ___ Python tracker ___

[issue11082] ValueError: Content-Length should be specified

2011-01-31 Thread William Wu
New submission from William Wu : I found this bug when I started to trying Python 3.2 release candidate 1. When using urllib.request.urlopen to handle HTTP POST, I got the error message: ValueError: Content-Length should be specified for iterable data of type 'foo=bar' I'll attach the pa