Message253114
According to https://docs.python.org/3/reference/lexical_analysis.html#lexical-analysis, the encoding of a sourcefile (in Python 3) defaults to utf-8* and a decoding error is (should be) reported as a SyntaxError. Since b"\x7f\x00\x00\n''s\x01\xfd\n'S" is not invalid as utf-8, I expect a UnicodeDecodeError converted to SyntaxError.
* compile(bytes, filename, mode) defaults to latin1 instead. It has no decoding problem, but quits with "ValueError: source code string cannot contain null bytes". On 2.7, I might expect that as the error.
I expect '''self.assertIn(b"Non-UTF-8", res.err)''' to always fail because error messages are strings, not bytes. That aside, have you ever seen that particular text (as a string) in a SyntaxError message?).
Why do you think the crash is during the tokenizing phase? I could not see anything in the AS report. |
|
Date |
User |
Action |
Args |
2015-10-17 02:36:08 | terry.reedy | set | recipients:
+ terry.reedy, Brian.Cain |
2015-10-17 02:36:08 | terry.reedy | set | messageid: <1445049368.55.0.412810876019.issue25388@psf.upfronthosting.co.za> |
2015-10-17 02:36:08 | terry.reedy | link | issue25388 messages |
2015-10-17 02:36:07 | terry.reedy | create | |
|