That’s strange all right, but perhaps it would be easier to see where the problem is if you didn’t cram so many operations into a single line. Rewrite it like this:
Looks like findFile is returning a panda “Filename”, which is not being accepted by the python open function. You might be able to put a str() around the Filename returned by findFile.
Actually, you would need to use filename.toOsSpecific() to make it into a string the open() would accept. Or, you could just put “from direct.stdpy.file import open” at the top of your file; the stdpy version of open() will accept a Filename directly (as well as a string).