[issue36064] docs: urllib.request.Request not accepting iterables data type

2019-03-29 Thread Julien Palard
Change by Julien Palard : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue36064] docs: urllib.request.Request not accepting iterables data type

2019-03-28 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I would propose closing it since docs were made improved and if type checking needs to be enforced then it can be discussed in the linked open issues that have patches. -- ___ Python tracker

[issue36064] docs: urllib.request.Request not accepting iterables data type

2019-03-28 Thread Carol Willing
Carol Willing added the comment: I've merged Julien Palard's doc PR. Is this sufficient to close this issue? -- ___ Python tracker ___

[issue36064] docs: urllib.request.Request not accepting iterables data type

2019-03-28 Thread Carol Willing
Carol Willing added the comment: New changeset 9e30fbac019d9c0a31d444a711e845c7e883caf5 by Carol Willing (Julien Palard) in branch 'master': bpo-36064: Clarify allowed data types for urllib.request.Request. (GH-11990)

[issue36064] docs: urllib.request.Request not accepting iterables data type

2019-02-22 Thread Julien Palard
Change by Julien Palard : -- pull_requests: +12013 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36064] docs: urllib.request.Request not accepting iterables data type

2019-02-22 Thread Martin Panter
Martin Panter added the comment: I agree the documentation is insufficient. It should have said if “data” is iterated, it must yield bytes-like objects. I agree it is unwise to yet more special cases for the uploaded data types. When Lye passed the dictionary of three keys and values, I

[issue36064] docs: urllib.request.Request not accepting iterables data type

2019-02-21 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Thank you @xtreak for adding Martin and Senthil. -- ___ Python tracker ___ ___ Python-bugs-list

[issue36064] docs: urllib.request.Request not accepting iterables data type

2019-02-21 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Stéphane, I don't know much about urllib to review this. The reason I said it's better document this is that there was an extended discussion on issue25439 along with a PR about type checking breaking some behavior and ambiguity in what is allowed

[issue36064] docs: urllib.request.Request not accepting iterables data type

2019-02-21 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: @xtreak I have just pushed a PR, if you think it's an issue related to the documentation, you can ignore my PR and in this case I will close it. now, it's not related to the doc, could you review it and give me your feedback? Thank you, --

[issue36064] docs: urllib.request.Request not accepting iterables data type

2019-02-21 Thread Stéphane Wirtel
Change by Stéphane Wirtel : -- keywords: +patch pull_requests: +12000 stage: -> patch review ___ Python tracker ___ ___

[issue36064] docs: urllib.request.Request not accepting iterables data type

2019-02-21 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: @xtreak ok because it's not related to the documentation, I have a fix for this issue but I am not sure about the title for this PR but what do you suggest? "Fix the encoding in _send_output when sending an iterable object via urllib.request.Request" ?

[issue36064] docs: urllib.request.Request not accepting iterables data type

2019-02-21 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: ok, I confirm this issue, now, with httpbin.org I get the same issue. and it's just when we try to send the stream to the server. -- ___ Python tracker

[issue36064] docs: urllib.request.Request not accepting iterables data type

2019-02-21 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I guess key should be bytes instead of a dict with string key. Maybe the docs could be improved about the case where key in case of dict should be bytes. >>> from urllib.request import urlopen, Request >>> r = Request("http://httpbin.org/post;,

[issue36064] docs: urllib.request.Request not accepting iterables data type

2019-02-21 Thread Lye
Lye added the comment: And I tested in both : Centos 6.10 4.14.77-70.59.amzn1.x86_64 -- ___ Python tracker ___ ___

[issue36064] docs: urllib.request.Request not accepting iterables data type

2019-02-21 Thread Lye
Lye added the comment: Hi @matrixise, Sorry that the example in that stackoverflow site is a dummy API server. I tested my code in a real API server so I can produce the error. I have re-tested my code with that dummy site and yes you won't able to get that error. To reproduce that error,

[issue36064] docs: urllib.request.Request not accepting iterables data type

2019-02-21 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: and I get the same result with the python:3.6.7 image docker > docker run --rm -v $PWD:/src -it python:3.6.7 python /src/demo.py Traceback (most recent call last): File "/usr/local/lib/python3.6/urllib/request.py", line 1318, in do_open

[issue36064] docs: urllib.request.Request not accepting iterables data type

2019-02-21 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Hi Lye, I am not sure it's a bug because I don't have any problem with your script. Here is your script. import urllib import urllib.request my_url = "https://api.foo.com; my_headers = { "Content-Type" : "application/x-www-form-urlencoded" } my_data = {

[issue36064] docs: urllib.request.Request not accepting iterables data type

2019-02-21 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Hi Lye, I didn't read your link, sorry you don't need to provide an example. We can work with this example. -- ___ Python tracker ___

[issue36064] docs: urllib.request.Request not accepting iterables data type

2019-02-21 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Thank you for your issue but could you provide an example file? Have a nice day. For the new contributors, this issue is marked as easy. -- keywords: +easy nosy: +matrixise ___ Python tracker

[issue36064] docs: urllib.request.Request not accepting iterables data type

2019-02-21 Thread Lye
New submission from Lye : I found out in the docs 3.6, in the class urllib.request.Request, for the input of 'data' data types, it says : "The supported object types include bytes, file-like objects, and iterables." But after testing it with data type dict for the 'data' input, I got error