diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2023-11-27 18:37:48 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-27 18:37:48 +0000 |
commit | 45d648597b1146431bf3d91041e60d7f040e70bf (patch) | |
tree | 28d15909930323f788e32e2b67263f1d9a026bb1 /Lib/test/test_syntax.py | |
parent | 2c8b19174274c183eb652932871f60570123fe99 (diff) | |
download | cpython-45d648597b1146431bf3d91041e60d7f040e70bf.tar.gz cpython-45d648597b1146431bf3d91041e60d7f040e70bf.zip |
gh-112387: Fix error positions for decoded strings with backwards tokenize errors (#112409)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r-- | Lib/test/test_syntax.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index e80e95383b8..99433df7338 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -2334,6 +2334,10 @@ func( """ self._check_error(code, "parenthesis '\\)' does not match opening parenthesis '\\['") + # Examples with dencodings + s = b'# coding=latin\n(aaaaaaaaaaaaaaaaa\naaaaaaaaaaa\xb5' + self._check_error(s, "'\(' was never closed") + def test_error_string_literal(self): self._check_error("'blech", r"unterminated string literal \(.*\)$") |