csachs / pyproject-flake8

pyproject-flake8 (pflake8), a monkey patching wrapper to connect flake8 with pyproject.toml configuration
The Unlicense
174 stars 16 forks source link

AttributeError in _read #16

Closed PietroPasotti closed 2 years ago

PietroPasotti commented 2 years ago

pflake8 my_file.py (ran by tox) fails with:

[...]
  File "/my-proj/.tox/lint/lib/python3.8/site-packages/flake8/options/config.py", line 66, in _read_config
    found_files.extend(config.read(filename))
  File "/usr/lib/python3.8/configparser.py", line 697, in read
    self._read(fp, filename)
  File "/my-proj/.tox/lint/lib/python3.8/site-packages/pflake8/__init__.py", line 30, in _read
    for key, value in section_to_copy.items():
AttributeError: 'list' object has no attribute 'items'

My pyproject.toml file contains only:

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

It looks to me like an obvious tiny bug; the default value of toml_config.get('tool') should not be [] but {}

wieczorek1990 commented 2 years ago

@csachs Seems OK.