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 <[EMAIL PROTECTED]> <http://bugs.python.org/issue1267> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com