[issue34777] urllib.request accepts anything as a header parameter for some URLs

2018-09-28 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Sure, thanks for the confirmation. Closing it as not a bug. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue34777] urllib.request accepts anything as a header parameter for some URLs

2018-09-28 Thread Jose Gama
Jose Gama added the comment: Yes, I agree, it's not a bug.This note might help other people who run into the same questions, particularly with error handling.Thank you! On Friday, September 28, 2018, 7:21:03 AM GMT+2, Karthikeyan Singaravelan wrote: Karthikeyan Singaravelan added the

[issue34777] urllib.request accepts anything as a header parameter for some URLs

2018-09-27 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks for the details. Each server behaves differently for these headers which depends on the server configuration and using other client like curl will also return the same result as Python does. So I would propose closing it as not a bug since t

[issue34777] urllib.request accepts anything as a header parameter for some URLs

2018-09-27 Thread Jose Gama
Jose Gama added the comment: Thank you for the quick reply. You are correct about the difficulties of using a universally accepted list.This is one example that generates errors on the server side. Just for the record. #!/usr/bin/env python3 from urllib.request import Request, urlopenfrom url

[issue34777] urllib.request accepts anything as a header parameter for some URLs

2018-09-24 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks for the report. I tried similar requests and it works this way for other tools like curl since Akcept could be a custom header in some use cases though it could be a typo in this context. There is no predefined set of media types that we ne

[issue34777] urllib.request accepts anything as a header parameter for some URLs

2018-09-23 Thread Jose Gama
New submission from Jose Gama : It is possible to use urllib.request defining a header that can be junk in some cases and still get the contents without any warning or error. The behavior depends on the URL and also on the header. -- components: IO files: header-illegal.py messages: 32