Terry J. Reedy <tjre...@udel.edu> added the comment:
The behavior remains the same in 3.11 ('main' branch). New PEG parser parses this the same. (Pablo, if there is a mistake below, please correct.) Normally, the parser copies code chars between quotes, with or without '\' interpretation, into a string object. When the 'f' prefix is given, the string gets divided into substrings and replacement fields. The code part of each replacement field is separately parsed. There are two options: 1. parse the field code while looking for an endcode marker; 2. look ahead for an endcode marker and then parse the code. The current behavior is consistent with opotion 1 and the python policy of reporting the first error found and exiting, rather than trying to resynchronize to try to find more errors. ---------- nosy: +pablogsal, terry.reedy resolution: -> not a bug stage: -> resolved status: open -> closed versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue45086> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com