[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 of:

"can't concat str to bytes"

It seems the docs should't say the 'data' data types support iterables.

There more detail discussion is at : 
https://stackoverflow.com/questions/54802272/some-fundamental-concept-used-in-python-docs

Hope this helps, thanks !

--
assignee: docs@python
components: Documentation
messages: 336198
nosy: docs@python, sylye
priority: normal
severity: normal
status: open
title: docs: urllib.request.Request not accepting iterables data type
type: enhancement
versions: Python 3.6, Python 3.7, Python 3.8

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



[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, you may try a valid API server, like 
'https://httpbin.org/post' . I just tested again by replacing :

my_url = "https://api.foo.com";

with 

my_url = "https://httpbin.org/post";

and able to get the same error again. Apology for not using a real API server 
in my example :)

--

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



[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 
<https://bugs.python.org/issue36064>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com