Skip to content

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

@kxrob

Description

@kxrob

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions