Message346693
Test leaking a temporary file in test_urllib:
test.test_urllib.urlretrieve_HttpTests.test_short_content_raises_ContentTooShortError_without_reporthook
I'm not sure of my fix:
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index f6ce9cb6d5..fdddd6e2d8 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -283,6 +283,7 @@ def urlretrieve(url, filename=None, reporthook=None, data=None):
reporthook(blocknum, bs, size)
if size >= 0 and read < size:
+ urlcleanup()
raise ContentTooShortError(
"retrieval incomplete: got only %i out of %i bytes"
% (read, size), result) |
|
Date |
User |
Action |
Args |
2019-06-26 22:39:18 | vstinner | set | recipients:
+ vstinner |
2019-06-26 22:39:18 | vstinner | set | messageid: <1561588758.0.0.133123257973.issue37421@roundup.psfhosted.org> |
2019-06-26 22:39:17 | vstinner | link | issue37421 messages |
2019-06-26 22:39:17 | vstinner | create | |
|