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

pylint 2.2.1 generates bad pylintrc for logging-format-style #2614

Closed
jwkvam opened this issue Nov 27, 2018 · 1 comment
Closed

pylint 2.2.1 generates bad pylintrc for logging-format-style #2614

jwkvam opened this issue Nov 27, 2018 · 1 comment

Comments

@jwkvam
Copy link
Contributor

jwkvam commented Nov 27, 2018

Steps to reproduce

In a new directory run the following

  1. pylint --generate-rcfile > pylintrc
  2. pylint

Current behavior

This gives a traceback:

Traceback (most recent call last):
  File "/Users/jacques/miniconda/bin/pylint", line 11, in <module>
    sys.exit(run_pylint())
  File "/Users/jacques/miniconda/lib/python3.7/site-packages/pylint/__init__.py", line 20, in run_pylint
    Run(sys.argv[1:])
  File "/Users/jacques/miniconda/lib/python3.7/site-packages/pylint/lint.py", line 1571, in __init__
    linter.load_config_file()
  File "/Users/jacques/miniconda/lib/python3.7/site-packages/pylint/config.py", line 751, in load_config_file
    for option, value in parser.items(section):
  File "/Users/jacques/miniconda/lib/python3.7/configparser.py", line 857, in items
    return [(option, value_getter(option)) for option in d.keys()]
  File "/Users/jacques/miniconda/lib/python3.7/configparser.py", line 857, in <listcomp>
    return [(option, value_getter(option)) for option in d.keys()]
  File "/Users/jacques/miniconda/lib/python3.7/configparser.py", line 854, in <lambda>
    section, option, d[option], d)
  File "/Users/jacques/miniconda/lib/python3.7/configparser.py", line 394, in before_get
    self._interpolate_some(parser, option, L, value, section, defaults, 1)
  File "/Users/jacques/miniconda/lib/python3.7/configparser.py", line 444, in _interpolate_some
    "found: %r" % (rest,))
configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%'

Expected behavior

I can run pylint without crashing. In fact, I cannot run pylint at all in the directory until I delete or modify pylintrc.

pylint --version output

pylint 2.2.1
astroid 2.1.0
Python 3.7.1 | packaged by conda-forge | (default, Nov 13 2018, 09:50:42) 
[Clang 9.0.0 (clang-900.0.37)]

Root cause

It seems that % is an escape character in pylintrc? I believe pylint should generate

logging-format-style=%%

Instead of

logging-format-style=%
@PCManticore
Copy link
Contributor

Thanks for reporting a bug, working on a fix.

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

2 participants