Replicate orrection #611 0.12 to master
ResourceWarning: unclosed file <_io.BufferedReader
Merge pull request #612 from avelino/master

Replicate orrection #611 0.12 to master