Uh oh!
There was an error while loading. Please reload this page.
Close file objects, requests.Responses - #1147
Conversation
These are good changes I think, but I guess there's also a case to be made for silencing ResourceWarnings about these things in the testsuite:
I'm not in favor of silencing: just mentioning it |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
MVrachev
left a comment
There was a problem hiding this comment.
Great changes!
I tried them locally and I don't see Resource warnings when running tests_download.py and tests_updater.py.
Can you increase the scope of this pr and fix the other instances in the other tests files Resource warnings (as mentioned in #1123) or that will be much of work right now?
jku
commented
Sep 18, 2020
This is the scope for now I think. Finding/fixing the trickier ones can take quite a bit of time |
joshuagl
left a comment
There was a problem hiding this comment.
Thanks for these changes, it's nice to see the number of warnings produced by the tests being reduced.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
* move code to only create objects after potential raises * Use 'with' when possible * close manually if those did not help Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
Use 'with' to avoid leaking responses when response.raise_for_status() is used. Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
* Remove dead urls: trust reader to find Requests documentation on their own * Mention that "stream" means that downloading the body is deferred Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
d79d3d9 to
fb9d8e7Comparejku
commented
Sep 22, 2020
The last change only updated the code comment in the first commit based on Joshuas comment. No other changes. |
Fixes issue #1099:
maybe also #1123 (but I've only gone through the code exercised by test_updater.py and test_download.py)
Description of the changes being introduced by the pull request:
Try to close all file objects and requests.Responses that are left open during test_updater.py and test_download.py execution.
Please verify and check that the pull request fulfills the following
requirements: