This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gvanrossum
Recipients brett.cannon, christian.heimes, gvanrossum
Date 2007-10-15.19:30:23
SpamBayes Score 0.00012507783
Marked as misclassified No
Message-id <ca471dc20710151230t3a127a39ya0ceb2a5b6d8d914@mail.gmail.com>
In-reply-to <4713B1DD.6000503@cheimes.de>
Content
Call PyTokenizer_Get until the line number is > 2?

On 10/15/07, Christian Heimes <report@bugs.python.org> wrote:
>
> Christian Heimes added the comment:
>
> > Try harder. :-) Look at the code that accomplishes this feat in the
> > regular parser...
>
> I've already found the methods that find the encoding in
> Parser/tokenizer.c: check_coding_spec() and friends.
>
> But it seems like a waste of time to use PyTokenizer_FromFile() just to
> find the encoding. *reading* Mmh ... It's not a waste of time if I can
> stop the tokenizer. I think it may be possible to use the tokenizer to
> get the encoding efficiently. I could read until
> tok_state->read_coding_spec or tok_state->indent != 0.
>
> Do you know a better way to stop the tokenizer when the line isn't a
> special comment line "# -*-"?
>
> Christian
>
> __________________________________
> Tracker <report@bugs.python.org>
> <http://bugs.python.org/issue1278>
> __________________________________
>
History
Date User Action Args
2007-10-15 19:30:23gvanrossumsetspambayes_score: 0.000125078 -> 0.00012507783
recipients: + gvanrossum, brett.cannon, christian.heimes
2007-10-15 19:30:23gvanrossumlinkissue1278 messages
2007-10-15 19:30:23gvanrossumcreate