For me, the problem was that I forgot to call read() on the IO object
read()
Basically I had to turn
with open(myFilePath, "r") as myFile: return myFile
into
with open(myFilePath, "r") as myFile: return myFile.read()