Message140683
| 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. |
|