Describe the bug
The input file handle doesn't appear to be closed properly in a variety of code paths, resulting in a ResourceWarning in modern Python versions. It would be great if this library automatically closed the handle properly.
Using context managers on file access is the best/proper way to solve this issue!