Quoting Chris Angelico <ros...@gmail.com>:

I'm pretty sure that server is in violation of the spec, so all bets
are off as to what any other server will do. If you know you're
dealing with this one server, you can probably hack around this, but I
don't think it belongs in core code. Unless, of course, I'm completely
wrong about the spec, or if there's a de facto spec that lots of
servers follow, in which case maybe it would be worth doing.

It would be possible to support this better by using "ascii" with
"surrogateescape" when receiving the redirect, and using the same
for all URLs coming into http.client. This would implement a
best-effort strategy at preserving the bogus URL, and still maintain
the notion that URLs are text (with the other path being to also
allow bytes as URLs, and always parsing Location as bytes).

Regards,
Martin

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to