This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: assertion failure in f-string parsing Parser/string_parser.c
Type: crash Stage: resolved
Components: Parser Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: eric.smith Nosy List: ammar2, eric.smith, gregory.p.smith, lys.nikolaou, miss-islington, pablogsal
Priority: normal Keywords: patch

Created on 2022-02-15 22:19 by ammar2, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 31365 merged eric.smith, 2022-02-16 01:25
PR 31370 merged miss-islington, 2022-02-16 10:54
PR 31371 merged miss-islington, 2022-02-16 10:54
Messages (6)
msg413302 - (view) Author: Ammar Askar (ammar2) * (Python committer) Date: 2022-02-15 22:19
Similar to https://bugs.python.org/issue46503 found by the ast.literal_eval fuzzer

```
>>> f'{<'
python: Parser/string_parser.c:346: fstring_compile_expr: Assertion `*expr_end == '}' || *expr_end == '!' || *expr_end == ':' || *expr_end == '='' failed.
[1]    14060 abort      ./python
```
msg413303 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2022-02-15 22:32
Good catch! I'll have a patch tonight.
msg413324 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2022-02-16 10:54
New changeset ffd9f8ff84ed53c956b16d027f7d2926ea631051 by Eric V. Smith in branch 'main':
bpo-46762: Fix an assert failure in f-strings where > or < is the last character if the f-string is missing a trailing right brace. (#31365)
https://github.com/python/cpython/commit/ffd9f8ff84ed53c956b16d027f7d2926ea631051
msg413325 - (view) Author: miss-islington (miss-islington) Date: 2022-02-16 11:16
New changeset 3d407b931156bc3ee5ae131de2f2babad831ccb2 by Miss Islington (bot) in branch '3.10':
bpo-46762: Fix an assert failure in f-strings where > or < is the last character if the f-string is missing a trailing right brace. (GH-31365)
https://github.com/python/cpython/commit/3d407b931156bc3ee5ae131de2f2babad831ccb2
msg413326 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2022-02-16 11:16
Thanks for the quick fix, Eric!
msg413328 - (view) Author: miss-islington (miss-islington) Date: 2022-02-16 11:18
New changeset a657bff34945e40be24cd75d02560a93b7623cf5 by Miss Islington (bot) in branch '3.9':
bpo-46762: Fix an assert failure in f-strings where > or < is the last character if the f-string is missing a trailing right brace. (GH-31365)
https://github.com/python/cpython/commit/a657bff34945e40be24cd75d02560a93b7623cf5
History
Date User Action Args
2022-04-11 14:59:56adminsetgithub: 90918
2022-02-16 12:17:31pablogsalsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2022-02-16 11:18:21miss-islingtonsetmessages: + msg413328
2022-02-16 11:16:24pablogsalsetmessages: + msg413326
2022-02-16 11:16:11miss-islingtonsetmessages: + msg413325
2022-02-16 10:54:34miss-islingtonsetpull_requests: + pull_request29521
2022-02-16 10:54:30miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request29520
2022-02-16 10:54:20eric.smithsetmessages: + msg413324
2022-02-16 01:25:07eric.smithsetkeywords: + patch
stage: patch review
pull_requests: + pull_request29515
2022-02-15 22:32:09eric.smithsetmessages: + msg413303
2022-02-15 22:19:52ammar2create