-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI: Flaky ResourceWarning('unclosed file <_io.BufferedRandom ... #44844
Comments
maybe related #44761 (comment) |
Thanks, but I believe we've been seeing this error in the CI prior to that PR. |
might be helpful for the next attempt at ResourceWarnings: my previous attempt at it #39047 |
Logging these warnings when they pop up 2021-12-15, #44908, py39GHA, |
Found a suspect from https://github.com/pandas-dev/pandas/runs/4540629821?check_suite_focus=true Think it's related to matplotlib/matplotlib#21646 (comment) TLDR from the log:
|
If matplotlib is related, I am not sure there's any way to avoid this besides blocking the reading of some font files. After investigating, I think at import time this object is reading certain files and might be leaving them open: https://github.com/matplotlib/matplotlib/blob/f6e0ee49c598f59c6e6cf4eefe473e4dc634a58a/src/ft2font.cpp#L322 EDIT: Narrowed it down to the |
So far the response from matplotlib is "this is the intended behavior". Opened up matplotlib/matplotlib#22017 for a hopeful resolution to this issue. I don't have many ideas how to reliably handle this case in the meantime
Anyone else have suggestions? |
Brainstorming:
|
Another idea: Add a check in |
Example:
https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=70478&view=logs&jobId=cb04ab33-336b-54ee-68fe-dcd3abde835b&j=cb04ab33-336b-54ee-68fe-dcd3abde835b&t=0558d00d-ff4a-5538-0de9-a0e7f449700f
Previous debugging attempt: #44634
Since it's a
io.BufferedRandom
, it should be a file handle opened in+
mode: #44634 (comment)This only appears when
tm.assert_produces_warning
is called since it's checking for extra warnings. It's likely coming from an optional dependency at this point, but unconfirmed.The text was updated successfully, but these errors were encountered: