datamol-io / datamol

Molecular Processing Made Easy.
https://docs.datamol.io
Apache License 2.0
452 stars 47 forks source link

Resolve ResourceWarning due to unclosed file in `datamol/mol.py` #211

Closed kkovary closed 11 months ago

kkovary commented 11 months ago

In the datamol package, the open_datamol_data_file function is used to open a file and retrieve its name. However, the file is not being properly closed after its name is retrieved, which is causing a ResourceWarning.

The offending line of code is: https://github.com/datamol-io/datamol/blob/22b5bb042bd166b2faa61476713ccd6ed521479b/datamol/mol.py#L48