In the Datiku documentation:
"We strongly recommend that you use the with keyword in Python to ensure that the writer is closed."
The problem is that as of Python 2.7.10, the file input module does not support being used as a context manager, i.e. the with statement, so you have to handle closing the sequence yourself.
I feel as though I am doing what @Clement Stenac suggested.