kapadia / usgs

Client library for interfacing with USGS datasets
http://kapadia.github.io/usgs/
ISC License
109 stars 38 forks source link

prevent resource warnings from unclosed ssl sockets #70

Closed coreyryanhanson closed 1 year ago

coreyryanhanson commented 1 year ago

When making many requests with this library, resource warnings from unclosed ssl sockets are inevitable.

This is because new request sessions are created with each call to the API but never closed.

With this pull request each session is generated using a context manager and automatically closed after each request is made.

kapadia commented 1 year ago

@coreyryanhanson thanks for the contribution

kapadia commented 1 year ago

Just uploaded to PyPI https://pypi.org/project/usgs/0.3.5/