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.

Author vstinner
Recipients aeros, eric.smith, gvanrossum, hroncok, lys.nikolaou, pablogsal, petr.viktorin, serhiy.storchaka, vstinner
Date 2020-05-15.02:54:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1589511259.58.0.717499662187.issue40246@roundup.psfhosted.org>
In-reply-to
Content
The following change broke test_fstring when using the old parser. I reopen the issue.

commit 846d8b28ab9bb6197ee81372820311c0abe509c0 (refs/bisect/bad)
Author: Lysandros Nikolaou <lisandrosnik@gmail.com>
Date:   Mon May 4 14:32:18 2020 +0300

    bpo-40246: Revert reporting of invalid string prefixes (GH-19888)
    
    Due to backwards compatibility concerns regarding keywords immediately followed by a string without whitespace between them (like in `bg="#d00" if clear else"#fca"`) will fail to parse,
    commit 41d5b94af44e34ac05d4cd57460ed104ccf96628 has to be reverted.


$ ./python -X oldparser -m test -v test_fstring 
(...)
======================================================================
FAIL: test_invalid_string_prefixes (test.test_fstring.TestCase) (str='BF""')
----------------------------------------------------------------------
  File "<string>", line 1
    BF""
      ^
SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/vstinner/python/master/Lib/test/test_fstring.py", line 29, in assertAllRaise
    eval(str)
AssertionError: "unexpected EOF while parsing" does not match "invalid syntax (<string>, line 1)"
(...)
History
Date User Action Args
2020-05-15 02:54:19vstinnersetrecipients: + vstinner, gvanrossum, eric.smith, petr.viktorin, serhiy.storchaka, hroncok, lys.nikolaou, pablogsal, aeros
2020-05-15 02:54:19vstinnersetmessageid: <1589511259.58.0.717499662187.issue40246@roundup.psfhosted.org>
2020-05-15 02:54:19vstinnerlinkissue40246 messages
2020-05-15 02:54:19vstinnercreate