mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.11] gh-115823: Calculate correctly error locations when dealing with implicit encodings (GH-115824) (#115950)
gh-115823: Calculate correctly error locations when dealing with implicit encodings (GH-115824)
(cherry picked from commit 015b97d19a
)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
This commit is contained in:
parent
0f7f5a4a6c
commit
35a43d4394
3 changed files with 14 additions and 12 deletions
|
@ -234,7 +234,7 @@ class ExceptionTests(unittest.TestCase):
|
|||
check('Python = "\u1e54\xfd\u0163\u0125\xf2\xf1" +', 1, 20)
|
||||
check(b'# -*- coding: cp1251 -*-\nPython = "\xcf\xb3\xf2\xee\xed" +',
|
||||
2, 19, encoding='cp1251')
|
||||
check(b'Python = "\xcf\xb3\xf2\xee\xed" +', 1, 18)
|
||||
check(b'Python = "\xcf\xb3\xf2\xee\xed" +', 1, 13)
|
||||
check('x = "a', 1, 5)
|
||||
check('lambda x: x = 2', 1, 1)
|
||||
check('f{a + b + c}', 1, 2)
|
||||
|
@ -301,6 +301,7 @@ class ExceptionTests(unittest.TestCase):
|
|||
{
|
||||
6
|
||||
0="""''', 5, 13)
|
||||
check('b"fooжжж"'.encode(), 1, 1, 1, 10)
|
||||
|
||||
# Errors thrown by symtable.c
|
||||
check('x = [(yield i) for i in range(3)]', 1, 7)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue