Message347056
| Author |
vstinner |
| Recipients |
vstinner, xtreak |
| Date |
2019年07月01日.18:01:47 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1562004108.37.0.0869622537038.issue37475@roundup.psfhosted.org> |
| In-reply-to |
| Content |
While working on bpo-37421 "Some tests leak temporary files", I had to write PR 14529 fix: test_urllib urlretrieve() tests now explicitly call urlcleanup() to remove temporary files.
If urlretrieve() caller forgets to remove the temporary file, the "temporary" file is left in the temporary directory, until this directory is cleared which may happen soon (next reboot?) or not.
When ContentTooShortError is raised, the temporary file is left in the temporary directory: the caller must call urlcleanup() explicitly. It sounds like a bug to me.
Is it really a good API if urlcleanup() must be called explicitly? I dislike having a "separated" function for the cleanup, whereas Python could rely on object lifetime to do the cleanup.
Should we deprecate this API in favor of a better urllib API? |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2019年07月01日 18:01:48 | vstinner | set | recipients:
+ vstinner, xtreak |
| 2019年07月01日 18:01:48 | vstinner | set | messageid: <1562004108.37.0.0869622537038.issue37475@roundup.psfhosted.org> |
| 2019年07月01日 18:01:48 | vstinner | link | issue37475 messages |
| 2019年07月01日 18:01:47 | vstinner | create |
|