Here's a paragraph from the Python API manual addressing this subject:
Note also that several of these functions take FILE* parameters. On
particular issue which needs to be handled carefully is that the FILE
structure for different C libraries can be different and incompatible.
Under Windows (at least), it is possible for dynamically linked
extensions to actually use different libraries, so care should be
taken that FILE* parameters are only passed to these functions if
it is certain that they were created by the same library that the
Python runtime is using.
--
http://python.org/doc/current/api/veryhigh.html
Jeff