New submission from hai shi <shihai1...@126.com>:

>>> "\x1"
  File "<stdin>", line 1
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in 
position 0-2: truncated \xXX escape

I think rasing the valueError would be exact.(pep223 agree this behavior: 
https://www.python.org/dev/peps/pep-0223/#bdfl-pronouncements).

And I think the error type could be changed in:
https://github.com/python/cpython/blob/master/Python/ast.c#L682

----------
components: Interpreter Core
messages: 346321
nosy: shihai1991
priority: normal
severity: normal
status: open
title: unicode error should raise a value error
type: behavior

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37377>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to