Christian Heimes added the comment: Brett Cannon wrote: > Brett Cannon added the comment: > > It looks like the file object returned by imp.find_module() has its read > position WAY too far forward (at least on OS X).
That's strange. It should never read more than 2 lines of a file. I don't understand how it could happen. char * PyTokenizer_FindEncoding(FILE *fp) { struct tok_state *tok; char *p_start=NULL, *p_end=NULL; if ((tok = PyTokenizer_FromFile(fp, NULL, NULL, NULL)) == NULL) { rewind(fp); return NULL; } while(((tok->lineno <= 2) && (tok->done == E_OK))) { PyTokenizer_Get(tok, &p_start, &p_end); } rewind(fp); return tok->encoding; } __________________________________ 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