Closed Bug 1909011 Opened 2 years ago Closed 10 months ago

ResourceWarning: unclosed file favicon.ico

Categories

(Socorro :: Backend, defect, P3)

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: relud, Unassigned)

References

Details

when cleaning up suppressed pytest warnings after removing boto in bug 1908543, I found out that a couple tests in webapp/crashstats/crashstats/tests/test_views.py were failing on:

ResourceWarning: unclosed file <_io.FileIO name='/app/webapp/crashstats/crashstats/static/img/favicon.ico' mode='rb' closefd=True>

I adjusted the warning suppression to be more specific, but we should fix the tests.

I don't think we can/should fix the test. This is coming from whatever is serving static files.

We could add a decorator to the test function to ignore this warning rather than ignore it in the filterwarnings:

https://docs.pytest.org/en/stable/how-to/capture-warnings.html#pytest-mark-filterwarnings

Then the ignoring is closer to the thing that needs ignoring.

In talking with Sven, this warning is related to how GC works based on the Python implementation. Since we're using CPython, which uses reference counting for GC, this warning isn't a problem for us. Also this is test code. Marking this as WONTFIX.

Status: NEW → RESOLVED
Closed: 10 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.