[issue29891] urllib.request.Request accepts but doesn't check bytes headers

2017-03-24 Thread Martin Panter
Martin Panter added the comment: If you enable BytesWarning (python -b) you do get an error: >>> urlopen(req, data) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.5/urllib/request.py", line 162, in urlopen return opener.open(url, data, timeout) File

[issue29891] urllib.request.Request accepts but doesn't check bytes headers

2017-03-23 Thread Maciej Szulik
Changes by Maciej Szulik : -- nosy: +maciej.szulik ___ Python tracker ___ ___

[issue29891] urllib.request.Request accepts but doesn't check bytes headers

2017-03-23 Thread Ezio Melotti
New submission from Ezio Melotti: urllib.request.Request allows the user to create a request object like: req = Request(url, headers={b'Content-Type': b'application/json'}) When calling urlopen(req, data), urllib will check if a 'Content-Type' header is present and fail to recognize