pymbtiles
pymbtiles copied to clipboard
File not properly closed
I got the following warning message when running a test :
path_to_project/.venv/lib/python3.9/site-packages/pymbtiles/__init__.py:89: ResourceWarning: unclosed file <_io.TextIOWrapper name='path_to_project/.venv/lib/python3.9/site-packages/pymbtiles/mbtiles_tile_schema.sql' mode='r' encoding='UTF-8'>
schema = open(
ResourceWarning: Enable tracemalloc to get the object allocation traceback
Thanks for the report. We indeed could have done a better job wrapping the read from this file in a context manager to ensure it gets closed right away, through it should have been closed just a few lines later when it went out of scope.
However, given the low severity of this and the very low maintenance frequency on this repository, I'm going to let this sit unfixed for the time being. At some point we're due for an update to supported versions of Python (drop Python 2 support!) and can easily take this up then.