Martin Panter added the comment:

What are the advantages of changing the default? Just that the user no longer 
has to set it manually?

What do you think of the problem mentioned in the documentation? If an existing 
HTTP 1.0 server that works fine in Python 3.5 were to suddenly have 
protocol_version="HTTP/1.1" forced by default, it sounds like all its responses 
may stop working (hang from the client’s POV) if they don’t explicitly close 
the connection.

One option could be to wrap the “wfile” stream in a chunk encoder, and insert 
Transfer-Encoding: chunked. I haven’t thought through this much, and it may not 
work very well because Python’s HTTP server is so low-level. This would 
basically be a HTTP 1.1 to HTTP 1.0 proxy.

Similarly, I understand HTTP 1.1 requires chunked encoding support for 
requests, but there is no support for that in the Python implementation. 
Existing servers accepting e.g. POST uploads would expect a Content-Length 
header, which would be hard to fake with a compatibility proxy (may need to 
buffer it all to count the bytes).

Another way might be a deprecation cycle, to force people using 3.6 to set 
protocol_version.

----------
type:  -> enhancement

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21224>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to