Message162205
| Author |
flox |
| Recipients |
flox |
| Date |
2012年06月03日.10:29:01 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1338719342.67.0.917704298784.issue14990@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I've hit this issue while playing with tokenize for the pep8.py module.
The tokenize detect_encoding() should report SyntaxError when the encoding is improperly declared.
However it raises a LookupError in some cases.
$ ./python -m tokenize Lib/test/bad_coding2.py
unexpected error: unknown encoding: utf8-sig
Traceback (most recent call last):
File "./Lib/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "./Lib/runpy.py", line 75, in _run_code
exec(code, run_globals)
File "./Lib/tokenize.py", line 686, in <module>
main()
File "./Lib/tokenize.py", line 656, in main
tokens = list(tokenize(f.readline))
File "./Lib/tokenize.py", line 489, in _tokenize
line = line.decode(encoding)
LookupError: unknown encoding: utf8-sig |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年06月03日 10:29:02 | flox | set | recipients:
+ flox |
| 2012年06月03日 10:29:02 | flox | set | messageid: <1338719342.67.0.917704298784.issue14990@psf.upfronthosting.co.za> |
| 2012年06月03日 10:29:02 | flox | link | issue14990 messages |
| 2012年06月03日 10:29:01 | flox | create |
|