[issue12576] urlib.request fails to open some sites

2011-07-27 Thread Barry A. Warsaw
Barry A. Warsaw 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 date:Wed Jul 27 09:37:17 2011 +0800 summary:

[issue12576] urlib.request fails to open some sites

2011-07-27 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Re-opening, as I think this needs to still be applied to Python 2.7. -- status: closed -> open ___ Python tracker ___

[issue12576] urlib.request fails to open some sites

2011-07-26 Thread Roundup Robot
Roundup Robot 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 'default': merge from 3.2 - Corr

[issue12576] urlib.request fails to open some sites

2011-07-26 Thread Roundup Robot
Roundup Robot 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 changeset a45c8ce67c7d by Senthil

[issue12576] urlib.request fails to open some sites

2011-07-24 Thread Senthil Kumaran
Senthil Kumaran 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 proceeds normally. P

[issue12576] urlib.request fails to open some sites

2011-07-23 Thread Georg Brandl
Georg Brandl 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 _

[issue12576] urlib.request fails to open some sites

2011-07-22 Thread Robert Xiao
Robert Xiao 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 x-amz-meta-s3fox-modifie

[issue12576] urlib.request fails to open some sites

2011-07-22 Thread Senthil Kumaran
Senthil Kumaran 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 _

[issue12576] urlib.request fails to open some sites

2011-07-22 Thread Senthil Kumaran
Changes by Senthil Kumaran : -- assignee: -> orsenthil ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://

[issue12576] urlib.request fails to open some sites

2011-07-22 Thread angus
angus 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 recognising 'tion: close

[issue12576] urlib.request fails to open some sites

2011-07-22 Thread Terry J. Reedy
Terry J. Reedy 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 _

[issue12576] urlib.request fails to open some sites

2011-07-21 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue12576] urlib.request fails to open some sites

2011-07-20 Thread Barry A. Warsaw
Barry A. Warsaw 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

[issue12576] urlib.request fails to open some sites

2011-07-19 Thread Robert Xiao
Robert Xiao 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 = >>> urllib.request.urlopen('http://s3.amazonaws.com/SurveyMonkey

[issue12576] urlib.request fails to open some sites

2011-07-18 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue12576] urlib.request fails to open some sites

2011-07-18 Thread STINNER Victor
STINNER Victor 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 issue is the "Connection

[issue12576] urlib.request fails to open some sites

2011-07-18 Thread Davide Rizzo
Changes by Davide Rizzo : -- nosy: +davide.rizzo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue12576] urlib.request fails to open some sites

2011-07-18 Thread STINNER Victor
STINNER Victor 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 -- ___

[issue12576] urlib.request fails to open some sites

2011-07-18 Thread STINNER Victor
STINNER Victor 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 called. The changelog of the fix

[issue12576] urlib.request fails to open some sites

2011-07-17 Thread Santoso Wijaya
Changes by Santoso Wijaya : -- nosy: +santa4nt versions: +Python 3.3 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue12576] urlib.request fails to open some sites

2011-07-16 Thread Nadeem Vawda
Changes by Nadeem Vawda : -- nosy: +nadeem.vawda ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue12576] urlib.request fails to open some sites

2011-07-16 Thread Senthil Kumaran
Senthil Kumaran 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 process. You could

[issue12576] urlib.request fails to open some sites

2011-07-16 Thread Ugra Dániel
New submission from Ugra Dániel : 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 raises "ValueError: