[issue4762] PyFile_FromFd() doesn't set the file name

STINNER Victor report at bugs.python.org
Sun Dec 28 18:05:10 CET 2008

STINNER Victor <victor.stinner at haypocalc.com> added the comment:

In my last patch to fix the issue #4705, I replaced PyFile_FromFd() by 
custom code which set correctly the file name.

PyFile_FromFd() is also used in:
 - _Py_DisplaySourceLine(): name is not used, only 
 - call_find_module() (imp.find_module()): return the file object with 
the wrong name

Example with imp:

>>> file, filename, extra = imp.find_module("os")
>>> file
<io.TextIOWrapper object at 0xb7b6ea6c>
>>> file.name
>>> filename

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list