Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Explicitly handle closing urllib.request.urlopen requests #22

Merged
merged 1 commit into from Jul 30, 2022

Conversation

ruohola
Copy link
Member

@ruohola ruohola commented Jul 30, 2022

It does close self.close() in its __del__ method[1], but it's better
to not just rely on the garbage collector here.

[1]: At least in CPython:
https://github.com/python/cpython/blob/cd26595232ac1b5061460d5949d5204c90287c1c/Lib/urllib/request.py#L1737

It does close `self.close()` in its `__del__` method[1], but it's better
to not just rely on the garbage collector here.

[1]: At least in CPython:
https://github.com/python/cpython/blob/cd26595232ac1b5061460d5949d5204c90287c1c/Lib/urllib/request.py#L1737
@ruohola ruohola requested a review from blomqma July 30, 2022 19:37
@codecov
Copy link

codecov bot commented Jul 30, 2022

Codecov Report

Merging #22 (f4fa383) into master (c917331) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master       #22   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          156       157    +1     
  Branches        13        13           
=========================================
+ Hits           156       157    +1     
Impacted Files Coverage Δ
apilytics/core.py 100.00% <100.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@ruohola ruohola enabled auto-merge July 30, 2022 19:42
@ruohola ruohola merged commit c60d103 into master Jul 30, 2022
@ruohola ruohola deleted the explicit-request-close branch July 30, 2022 21:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants