close file explicitly to avoid different behaviors between pypy and cpython