You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ python str_fmt.py
Traceback (most recent call last):
File "str_fmt.py", line 10, in <module>
print("%j\t%s\t%s\n" % (a, b, c))
ValueError: unsupported format character 'j' (0x6a) at index 1
Please provide the exact, unmodified output of flake8 --bug-report
Static code analysis could spot this kind of error and prevent ValueError: unsupported format character exceptions. In my experience this kind of error is particularly common in corner cases for error handling or logging code which is not exhaustively tested.
This is analogous to the flake8 warning akin to W605 invalid escape sequence (although that does not usually trigger an exception), but for invalid percent placeholders.
The text was updated successfully, but these errors were encountered:
Flake8 is merely a framework which other linters run under and does not implement any rules itself. I'd suggest either writing a plugin or reporting this to pyflakes / pycodestyle. I think there's something underway in pyflakes for this already : PyCQA/pyflakes#370
Thank you - I used slightly different search terms so didn't find that. Also, I wasn't sure if it would fall under pyflakes or pycodestyle, so reported it here.
In GitLab by @pjacock on Mar 4, 2019, 06:44
Please read this brief portion of documentation before going any further: http://flake8.pycqa.org/en/latest/internal/contributing.html#filing-a-bug
Please describe how you installed Flake8
Please describe the problem or feature
Consider this example, call it
str_fmt.py
:Currently flake8 does not report any problem with this file:
However, on running it:
Please provide the exact, unmodified output of
flake8 --bug-report
Not a bug, but for reference:
Please describe the problem or feature
Static code analysis could spot this kind of error and prevent
ValueError: unsupported format character
exceptions. In my experience this kind of error is particularly common in corner cases for error handling or logging code which is not exhaustively tested.This is analogous to the flake8 warning akin to
W605 invalid escape sequence
(although that does not usually trigger an exception), but for invalid percent placeholders.The text was updated successfully, but these errors were encountered: