summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_syntax.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-11-27 19:05:20 (GMT)
committerGitHub <noreply@github.com>2023-11-27 19:05:20 (GMT)
commit390a5b81a97a36d5166a62e7850fadfe9eba3cc3 (patch)
tree29de44b648d3d6c707f7b420c5b18352a283c154 /Lib/test/test_syntax.py
parent43b081bfc49173405576b8eba09a6ca86aac641b (diff)
downloadcpython-390a5b81a97a36d5166a62e7850fadfe9eba3cc3.zip
cpython-390a5b81a97a36d5166a62e7850fadfe9eba3cc3.tar.gz
cpython-390a5b81a97a36d5166a62e7850fadfe9eba3cc3.tar.bz2
[3.11] gh-112387: Fix error positions for decoded strings with backwards tokenize errors (GH-112409) (#112469)
gh-112387: Fix error positions for decoded strings with backwards tokenize errors (GH-112409) (cherry picked from commit 45d648597b1146431bf3d91041e60d7f040e70bf) Signed-off-by: Pablo Galindo <pablogsal@gmail.com> Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r--Lib/test/test_syntax.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index bbd22ec..88d117f 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -2143,6 +2143,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", "unterminated string literal")