Barry A. Warsaw ba...@python.org added the comment:
Re-opening, as I think this needs to still be applied to Python 2.7.
--
status: closed - open
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12576
Barry A. Warsaw ba...@python.org added the comment:
Never mind. This changeset got applied to 2.7 (thanks!) but didn't get linked
in the tracker.
changeset: 71523:b66bbbdc7abd
branch: 2.7
parent: 71518:73ae3729b8fe
user:Senthil Kumaran sent...@uthcode.com
date:Wed
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset 9eac48fbe21d by Senthil Kumaran in branch '3.2':
Fix closes Issue12576 - fix urlopen behavior on sites which do not send (or
obsfuscates) Connection: Close header.
http://hg.python.org/cpython/rev/9eac48fbe21d
New
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset d58b43fb9208 by Senthil Kumaran in branch '3.2':
Correcting issue 12576 fix, which resulted in buildbot failures.
http://hg.python.org/cpython/rev/d58b43fb9208
New changeset dcfce522723d by Senthil Kumaran in branch
Senthil Kumaran sent...@uthcode.com added the comment:
I propose the attached patch as fix to this issue. All it does is, moves the
code of getting http response to the finally block of the http request. It
closes the sockets if the getting the response fails for some reason, otherwise
it
angus an...@amcinnes.info added the comment:
I'm experiencing a related problem:
---
from urllib.request import urlopen
print(urlopen('https://mtgox.com/').read())
---
prints b'' rather than the page content.
It looks like mtgox.com always sends 'Connection: Keep-Alive'. So some hack
like
Changes by Senthil Kumaran sent...@uthcode.com:
--
assignee: - orsenthil
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12576
___
___
Senthil Kumaran sent...@uthcode.com added the comment:
I am against hacks like tion: close. Under worst case, we shall revert
the change which caused this regression in the first place.
--
___
Python tracker rep...@bugs.python.org
Robert Xiao nneon...@gmail.com added the comment:
S3 also doesn't send any kind of connection header at all.
x-amz-id-2: WWuo30Fk2inKVcC5dH4GOjvHxnqMa5Q2+AduPm2bMhL1h3GqzOR0EPwUv0biqv2V
x-amz-request-id: 3CCF6B6A000E6446
Date: Sat, 23 Jul 2011 06:42:45 GMT
x-amz-meta-s3fox-filesize: 27692
Georg Brandl ge...@python.org added the comment:
Recognizing ction: close as Connection: close is exactly what those servers
do *not* want you to do.
--
nosy: +georg.brandl
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12576
Terry J. Reedy tjre...@udel.edu added the comment:
Could we look for 'tion: Closed' instead of Connection: Closed, to accomodate
servers that garble the response, even if it is a hack?
--
nosy: +terry.reedy
___
Python tracker rep...@bugs.python.org
Changes by STINNER Victor victor.stin...@haypocalc.com:
--
nosy: +ezio.melotti
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12576
___
___
Barry A. Warsaw ba...@python.org added the comment:
I think this is also a regression in Python 2.7, as reported here:
https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/813295
--
nosy: +barry
versions: +Python 2.7
___
Python tracker
Robert Xiao nneon...@gmail.com added the comment:
Seconded. #12133 inadvertently closes the response object if the server fails
to indicate Connection: close. In my case, Amazon S3 (s3.amazonaws.com)
causes this problem:
(Python 3.2)
conn =
STINNER Victor victor.stin...@haypocalc.com added the comment:
h.close() (HTTPConnection.close) in the finally block of
AbstractHTTPHandler.do_open() calls indirectly r.close() (HTTPResponse.close).
The problem is that the content of the response cannot be read if its close()
method was
STINNER Victor victor.stin...@haypocalc.com added the comment:
ValueError('I/O operation on closed file') error comes from
HTTPResponse.__enter__() which is implemented in IOBase:
def __enter__(self): # That's a forward reference
self._checkClosed()
return self
--
Changes by Davide Rizzo sor...@gmail.com:
--
nosy: +davide.rizzo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12576
___
___
Python-bugs-list
STINNER Victor victor.stin...@haypocalc.com added the comment:
imdb.com and python.org use HTTP/1.1. imdb.com server sends a
Transfer-encoding: chunked header whereas python.org doesn't. python.org has
a Connection: close header, whereas imdb.com doesn't.
The more revelant difference for this
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12576
___
___
Python-bugs-list
Changes by Nadeem Vawda nadeem.va...@gmail.com:
--
nosy: +nadeem.vawda
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12576
___
___
Changes by Santoso Wijaya santoso.wij...@gmail.com:
--
nosy: +santa4nt
versions: +Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12576
___
New submission from Ugra Dániel daniel.u...@gmail.com:
Issue #12133 introduced a patch which seems to cause problems.
I'm using Python 3.2.1 on 64-bit Arch Linux (this version already incorporates
the changes from #12133).
The following code:
with urllib.request.urlopen(url) as page:
pass
Senthil Kumaran sent...@uthcode.com added the comment:
On Sun, Jul 17, 2011 at 12:07:44AM +, Ugra Dániel wrote:
For example IMDb's Cneonction: close (not a typo) feature. But
This is a mistake at the server and urllib relies on the
Connection: close header at some point in time in the
23 matches
Mail list logo