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 christian.heimes
Recipients brett.cannon, christian.heimes, gvanrossum
Date 2007-10-15.18:30:56
SpamBayes Score 0.0021824138
Marked as misclassified No
Message-id <4713B1DD.6000503@cheimes.de>
In-reply-to <ca471dc20710151102w63df9e5ew359cc6ec13c2442@mail.gmail.com>
Content
> 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
History
Date User Action Args
2007-10-15 18:30:56christian.heimessetspambayes_score: 0.00218241 -> 0.0021824138
recipients: + christian.heimes, gvanrossum, brett.cannon
2007-10-15 18:30:56christian.heimeslinkissue1278 messages
2007-10-15 18:30:56christian.heimescreate