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

flake8 versions prior 3.7.8 fails to process nested classes whitelist option #1093

Closed
n1kolasM opened this issue Dec 26, 2019 · 0 comments · Fixed by #1094
Closed

flake8 versions prior 3.7.8 fails to process nested classes whitelist option #1093

n1kolasM opened this issue Dec 26, 2019 · 0 comments · Fixed by #1094
Labels
bug Something isn't working pr-merged

Comments

@n1kolasM
Copy link
Contributor

Bug report

What's wrong

Option processing in flake8 versions prior 3.7.8 differs from later option processing, and defaults of nested class whitelist options break flake8 at startup.

I bisected this problem to flake8 commit fb7e9338cd06760a2f9096f976f0e246fc36a09e, when changes in flake8/utils.py function parse_comma_separated_list were made.

To solve this problem either minimal flake8 version should be increased to 3.7.8 or type of nested class whitelist option defaults should be changed.

$ flake8

Traceback (most recent call last):
  File "/nix/store/xp46dxgjkz9l5plhzjgm3p9isgdv2mjq-python3.7-flake8-3.7.7/bin/.flake8-wrapped", line 11, in <module>
    sys.exit(main())
  File "/nix/store/xp46dxgjkz9l5plhzjgm3p9isgdv2mjq-python3.7-flake8-3.7.7/lib/python3.7/site-packages/flake8/main/cli.py", line 18, in main
    app.run(argv)
  File "/nix/store/xp46dxgjkz9l5plhzjgm3p9isgdv2mjq-python3.7-flake8-3.7.7/lib/python3.7/site-packages/flake8/main/application.py", line 394, in run
    self._run(argv)
  File "/nix/store/xp46dxgjkz9l5plhzjgm3p9isgdv2mjq-python3.7-flake8-3.7.7/lib/python3.7/site-packages/flake8/main/application.py", line 381, in _run
    self.initialize(argv)
  File "/nix/store/xp46dxgjkz9l5plhzjgm3p9isgdv2mjq-python3.7-flake8-3.7.7/lib/python3.7/site-packages/flake8/main/application.py", line 366, in initialize
    self.parse_configuration_and_cli(argv)
  File "/nix/store/xp46dxgjkz9l5plhzjgm3p9isgdv2mjq-python3.7-flake8-3.7.7/lib/python3.7/site-packages/flake8/main/application.py", line 219, in parse_configuration_and_cli
    self.option_manager, self.config_finder, argv
  File "/nix/store/xp46dxgjkz9l5plhzjgm3p9isgdv2mjq-python3.7-flake8-3.7.7/lib/python3.7/site-packages/flake8/options/aggregator.py", line 33, in aggregate_options
    default_values, _ = manager.parse_args([], values=values)
  File "/nix/store/xp46dxgjkz9l5plhzjgm3p9isgdv2mjq-python3.7-flake8-3.7.7/lib/python3.7/site-packages/flake8/options/manager.py", line 312, in parse_args
    self._normalize(options)
  File "/nix/store/xp46dxgjkz9l5plhzjgm3p9isgdv2mjq-python3.7-flake8-3.7.7/lib/python3.7/site-packages/flake8/options/manager.py", line 305, in _normalize
    setattr(options, option.dest, option.normalize(old_value))
  File "/nix/store/xp46dxgjkz9l5plhzjgm3p9isgdv2mjq-python3.7-flake8-3.7.7/lib/python3.7/site-packages/flake8/options/manager.py", line 151, in normalize
    return utils.parse_comma_separated_list(value)
  File "/nix/store/xp46dxgjkz9l5plhzjgm3p9isgdv2mjq-python3.7-flake8-3.7.7/lib/python3.7/site-packages/flake8/utils.py", line 44, in parse_comma_separated_list
    value = regexp.split(value)
TypeError: expected string or bytes-like object

How is that should be

flake8 should work.

System information

NixOS 19.09.1484.84586a4514d (Loris)

flake8 information

flake8 --bug-report fails with the same error

pip information

Contents of pip freeze:

astor==0.8.0
attrs==18.2.0
bandit==1.6.2
cognitive-complexity==0.0.4
colorama==0.4.1
darglint==1.1.0
ddt==1.2.1
docutils==0.14
entrypoints==0.3
eradicate==1.0
flake8==3.7.7
flake8-annotations-complexity==0.0.2
flake8-bandit==2.1.2
flake8-broken-line==0.1.1
flake8-bugbear==19.8.0
flake8-builtins==1.4.2
flake8-coding==1.3.2
flake8-commas==2.0.0
flake8-comprehensions==3.1.4
flake8-debugger==3.1.0
flake8-docstrings==1.5.0
flake8-eradicate==0.2.4
flake8-executable==2.0.3
flake8-isort==2.8.0
flake8-logging-format==0.6.0
flake8-pep3101==1.3.0
flake8-polyfill==1.0.2
flake8-print==3.1.4
flake8-quotes==2.1.1
flake8-rst-docstrings==0.0.12
flake8-string-format==0.2.3
future==0.17.1
gitdb2==2.0.5
GitPython==2.1.11
importlib-metadata==0.18
isort==4.3.20
mando==0.6.4
mccabe==0.6.1
pbr==5.1.3
pep8-naming==0.9.1
pycodestyle==2.5.0
pydocstyle==2.1.1
pyflakes==2.1.1
Pygments==2.4.2
PyStemmer==1.3.0
PyYAML==5.1.1
radon==4.0.0
restructuredtext-lint==1.3.0
six==1.12.0
smmap2==2.0.5
snowballstemmer==1.2.1
stevedore==1.30.1
testfixtures==6.3.0
toml==0.10.0
typing-extensions==3.7.4
wemake-python-styleguide==0.13.3
zipp==0.5.1
@n1kolasM n1kolasM added the bug Something isn't working label Dec 26, 2019
n1kolasM added a commit to n1kolasM/wemake-python-styleguide that referenced this issue Dec 27, 2019
n1kolasM added a commit to n1kolasM/wemake-python-styleguide that referenced this issue Dec 27, 2019
n1kolasM added a commit to n1kolasM/wemake-python-styleguide that referenced this issue Dec 27, 2019
n1kolasM added a commit to n1kolasM/wemake-python-styleguide that referenced this issue Dec 27, 2019
n1kolasM added a commit to n1kolasM/wemake-python-styleguide that referenced this issue Dec 27, 2019
@helpr helpr bot added the pr-available label Dec 27, 2019
@helpr helpr bot added pr-merged and removed pr-available labels Dec 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pr-merged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant