[issue1267] Py3K cannot run as ``python -S``

Christian Heimes report at bugs.python.org
Sat Oct 20 23:12:30 CEST 2007


Christian Heimes added the comment:

> The dangers of switching between fileno(fp) and fp are actually well
> documented in the C and/or POSIX standards. The problem is caused in
> PyFile_FromFileEx() -- it creates a Python file object from the file
> descriptor. The fix actually only works because we're not using the
> FILE struct once PyTokenizer_FindEncoding() is called. I think it
> would be better to move the lseek() into call_find_module() so the
> FILE abstraction is not broken by PyTokenizer_FindEncoding().

FYI:

http://www.gnu.org/software/libc/manual/html_mono/libc.html#Stream_002fDescriptor-Precautions
http://www.gnu.org/software/libc/manual/html_mono/libc.html#Cleaning-Streams

Christian

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1267>
__________________________________


More information about the Python-bugs-list mailing list