added data.close() to python files