Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kxrob opened this issue Jun 29, 2020 · 0 comments

Comments

@kxrob
Copy link

kxrob commented Jun 29, 2020

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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant