-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crash reading file with UTF-8 BOM + "# coding: utf-8" (supported since python 2.5) #189
Comments
Sounds great, you plan to do a PR? |
Sure. I gave a look at what cpython does now, and it looks like it compares the BOM and the comment, which sounds reasonable to me. https://github.com/python/cpython/blob/master/Parser/tokenizer.c#L333-L339 |
Ah note that the code will also be tested against pypy so if they don't support that that will be a problem. We could make an interpreter branch though and only support that for CPython... |
I tried, and pypy seems to have the same behavior (crashes only if there is a BOM but the comment says |
Cool :) 2015-08-05 18:48 GMT+02:00 Leonardo Pistone [email protected]:
|
allow utf8 BOM + magic comment, closes #189
Reading such a file fails at
https://github.com/mitsuhiko/babel/blob/master/babel/util.py#L81
however, those files seem to be supported since 2.5:
https://bugs.python.org/issue1378022
Would you consider a patch to allow such files in babel?
Thanks!
The text was updated successfully, but these errors were encountered: