Skip to content

bpo-45848: Delimitate when source lines can't be located in the parser error handling functions#29626

Closed
pablogsal wants to merge 2 commits into
python:mainfrom
pablogsal:error_offset
Closed

bpo-45848: Delimitate when source lines can't be located in the parser error handling functions#29626
pablogsal wants to merge 2 commits into
python:mainfrom
pablogsal:error_offset

Conversation

@pablogsal

@pablogsal pablogsal commented Nov 18, 2021

Copy link
Copy Markdown
Member

@ambv ambv removed the skip issue label Nov 19, 2021
@ambv ambv changed the title Delimitate when source lines can't be located in the parser error handling functions bpo-45848: Delimitate when source lines can't be located in the parser error handling functions Nov 19, 2021
@ambv

ambv commented Nov 19, 2021

Copy link
Copy Markdown
Contributor

Running the test I added with the fix:

test_encoding_cookie (test.test_peg_generator.test_c_parser.TestCPythonParserEdgeCases) ... ok

----------------------------------------------------------------------
Ran 1 test in 0.125s

OK

== Tests result: SUCCESS ==

Running the test without the fix:

test test_peg_generator failed -- Traceback (most recent call last):
  File "/private/tmp/cpymain/Lib/test/test_peg_generator/test_c_parser.py", line 512, in test_encoding_cookie
    self.assert_python(
    ^^^^^^^^^^^^^^^^^^^
  File "/private/tmp/cpymain/Lib/test/test_peg_generator/test_c_parser.py", line 507, in assert_python
    self.assertNotIn(not_expected, output)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Fatal Python error: Aborted' unexpectedly found in '\nAssertion failed: (p->tok->fp == NULL || p->tok->fp == stdin), function get_error_line, file Parser/pegen.c, line 408.\nFatal Python error: Aborted\n\nCurrent thread 0x000000010f006dc0 (most recent call first):\n  <no Python frame>\n'

test_peg_generator failed (1 failure)

== Tests result: FAILURE ==

@pablogsal

pablogsal commented Nov 19, 2021

Copy link
Copy Markdown
Member Author

@ambv I am closing this in favour of a more complete and robust version: #29646

@pablogsal pablogsal closed this Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants