Currently, the fastcdc_(py|cy) functions leave the file descriptor open after returning the generator since the generator requires it. This can result in a memory leak for non-CPython interpreters that do not utilize memory reference counting. To address this issue, I propose adding a boolean parameter called closefd to the chunk_generator function, along with some corresponding if code. I am confident that I can make these changes myself once my current pull request #16 is merged.
Alternative: Convert fastcdc_(py|cy) functions into generators themselves plus using with open(...) expression inside.