False errors with named format string placeholders: "% ... has unsupported format character '(' " ...
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 190
- Avg merge
- 8m
- Merged PRs (30d)
- 13
Description
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'
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the supplied Python 3.7 example with pyflakes v2.2.0 and confirm the reported false errors. Trace the format-string checking entry point and add a regression test for the named placeholder containing the strftime expression. Done means valid Python 2 and Python 3 expressions no longer produce unsupported-format-character errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100