close file opened by init

close file opened by init
and
modify open('rU') to open('r') because it is the same for rstrip

No warning in python 3 tests now.
It also pass in python 2 test.