Message140683
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. |
|
Date |
User |
Action |
Args |
2011-07-19 17:29:38 | nneonneo | set | recipients:
+ nneonneo, orsenthil, vstinner, nadeem.vawda, eric.araujo, daniel.ugra, santoso.wijaya, davide.rizzo |
2011-07-19 17:29:38 | nneonneo | set | messageid: <1311096578.47.0.289867559676.issue12576@psf.upfronthosting.co.za> |
2011-07-19 17:29:37 | nneonneo | link | issue12576 messages |
2011-07-19 17:29:37 | nneonneo | create | |
|