[issue12849] Cannot override 'connection: close' in urllib2 headers

2020-03-09 Thread henrik242


henrik242  added the comment:

Correction: My problem in Issue 39875 was not related to Connection: Close, but 
with weird POST handling in Solr.

--

___
Python tracker 

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



[issue12849] Cannot override 'connection: close' in urllib2 headers

2020-03-06 Thread henrik242


henrik242  added the comment:

That mandatory "Connection: close" makes it impossible to POST a data request 
to Solr, as described in https://bugs.python.org/issue39875

It would be very helpful if it could be made optional.

--
nosy: +henrik242
versions: +Python 3.7

___
Python tracker 

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



[issue12849] Cannot override 'connection: close' in urllib2 headers

2015-09-08 Thread Martin Panter

Martin Panter added the comment:

Just closed Issue 25037 about a server that omits the chunk length headers when 
“Connection: closed” is used.

I wonder if it would be such a bad idea to just remove the “Connection: closed” 
flag. It was added in 2004 in revision 5e7455fb8db6, but I do not agree with 
the reason given in the commit message and comment. Adding the flag is only 
really a courtesy to the server, saying it can drop the connection once it 
sends the response. Removing it in theory shouldn’t change anything about how 
the client parses the HTTP response, but in practice it seems it may improve 
compatibility with buggy servers.

--
status: pending -> open

___
Python tracker 

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



[issue12849] Cannot override 'connection: close' in urllib2 headers

2015-05-22 Thread Martin Panter

Martin Panter added the comment:

So far the only reasons that have been given to override this header (mine and 
the one in Issue 15943) seem to be to work around buggy servers. It is already 
documented that HTTP 1.1 and “Connection: close” are used, so if this issue is 
only about working around buggy servers, the best thing might be to close this 
as being “not a Python bug”. The user can always still use the low-level HTTP 
client, or make a custom urllib.request handler class (which is what I did).

Shubhojeet: What was the reason you wanted to set a keep-alive header?

If this is about proper keep-alive (a.k.a persistent) connection support in 
urllib.request, perhaps have a look at Issue 9740.

--
resolution:  - not a bug
status: open - pending

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12849
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12849] Cannot override 'connection: close' in urllib2 headers

2015-04-01 Thread xiaobing jiang

Changes by xiaobing jiang s7v7nisla...@gmail.com:


--
nosy: +s7v7nisla...@gmail.com

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12849
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12849] Cannot override 'connection: close' in urllib2 headers

2015-02-12 Thread Demian Brecht

Changes by Demian Brecht demianbre...@gmail.com:


--
nosy:  -demian.brecht

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12849
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12849] Cannot override 'connection: close' in urllib2 headers

2014-06-19 Thread Demian Brecht

Demian Brecht added the comment:

The problem here as far as I can tell is that the underlying file object 
(addinfourl) blocks while waiting for a full response from the server. As 
detailed in section 8.1 of RFC 2616, requests and responses can be pipelined, 
meaning requests can be sent while waiting for full responses from a server.

The suggested change of overriding headers is only a partial solution as it 
doesn't allow for non-blocking pipelining.

@Martin Panter: My suggestion for you would simply be to use http.client 
(httplib) as R. David Murray suggests, which doesn't auto-inject the Connection 
header. Also, a server truncating responses when Connection: close is sent 
sounds like a server-side bug to me. Unless you're a server maintainer (or have 
access to the developers), have you tried reaching out to them to request a fix?

--
nosy: +dbrecht

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12849
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12849] Cannot override 'connection: close' in urllib2 headers

2014-02-16 Thread Martin Panter

Changes by Martin Panter vadmium...@gmail.com:


--
nosy: +vadmium

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12849
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12849] Cannot override 'connection: close' in urllib2 headers

2014-02-16 Thread Martin Panter

Martin Panter added the comment:

I suggest using setdefault() in urllib.request.AbstractHTTPHandler.do_open():

headers.setdefault(Connection, close)

I am trying to work around a server that truncates its response when this 
header is sent, and this change would allow me to specify 
headers={Connection, Keep-Alive} to get the same effect as dropping the 
Connection header. This is also consistent with the way the other headers 
(Accept-Encoding, User-Agent, Host) may be overridden.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12849
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12849] Cannot override 'connection: close' in urllib2 headers

2012-09-17 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12849
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12849] Cannot override 'connection: close' in urllib2 headers

2012-09-14 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
title: urllib2 headers issue - Cannot override 'connection: close' in urllib2 
headers

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12849
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com