pyflakes icon indicating copy to clipboard operation
pyflakes copied to clipboard

False errors with named format string placeholders: "% ... has unsupported format character '(' " ...

Open kxrob opened this issue 5 years ago • 0 comments

pyflakes v2.2.0 (on PY3.7) barks incorrectly on complex expressions in named placeholders of classic format strings - which are valid Python3 & Python2. The bug was not in pyflakes v2.1.1 (on PY2.7 at least). This test code produces the false errors shown below:

def f():
    da = datetime.date.today()
    six.print_("test %(da.strftime('%a %Y-%m-%d'))s" % EvalDict()) 

False errors:

x.py:9:16 '...' % ... has unsupported format character '('
x.py:9:16 '...' % ... has unsupported format character 'Y'
x.py:9:16 '...' % ... has unsupported format character 'm'

kxrob avatar Jun 29 '20 13:06 kxrob