xxxxxxxxxx
This ResourceWarning means that you opened a file, used it,
but then forgot to close the file. Python closes it for you when
it notices that the file object is dead, but this only occurs
after some unknown time has elapsed. Thus in recent versions,
Python also prints a ResourceWarning when it does that.