This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nneonneo
Recipients daniel.ugra, davide.rizzo, eric.araujo, nadeem.vawda, nneonneo, orsenthil, santoso.wijaya, vstinner
Date 2011-07-19.17:29:37
SpamBayes Score 0.005216011
Marked as misclassified No
Message-id <1311096578.47.0.289867559676.issue12576@psf.upfronthosting.co.za>
In-reply-to
Content
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/SurveyMonkeyFiles/VPAT_SurveyMonkey.pdf')
>>> len(conn.read())
27692

(Python 3.2.1)
>>> conn = urllib.request.urlopen('http://s3.amazonaws.com/SurveyMonkeyFiles/VPAT_SurveyMonkey.pdf')
>>> len(conn.read())
0

The problem is that S3 doesn't send back a "Connection: close" header, so when h.close() is called from request.py, the request object is also closed; consequently, conn.fp is None and so conn.read() returns an empty bytes object.

This is a clear regression due to the patch in #12133.
History
Date User Action Args
2011-07-19 17:29:38nneonneosetrecipients: + nneonneo, orsenthil, vstinner, nadeem.vawda, eric.araujo, daniel.ugra, santoso.wijaya, davide.rizzo
2011-07-19 17:29:38nneonneosetmessageid: <1311096578.47.0.289867559676.issue12576@psf.upfronthosting.co.za>
2011-07-19 17:29:37nneonneolinkissue12576 messages
2011-07-19 17:29:37nneonneocreate