datamol-io / datamol

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

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

Closed kkovary closed 1 year ago

kkovary commented 1 year 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