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

Error while run pylint --generate-toml-config #8662

Closed
IamRezaMousavi opened this issue May 5, 2023 · 2 comments
Closed

Error while run pylint --generate-toml-config #8662

IamRezaMousavi opened this issue May 5, 2023 · 2 comments
Labels
Duplicate 🐫 Duplicate of an already existing issue
Milestone

Comments

@IamRezaMousavi
Copy link

Bug description

Cann`t generate toml config file

Configuration

No response

Command used

pylint --generate-toml-config

Pylint output

Traceback (most recent call last):
  File "/run/media/reza/24B0FBEEB0FBC478/w/test/pylint/venv/bin/pylint", line 8, in <module>
    sys.exit(run_pylint())
  File "/run/media/reza/24B0FBEEB0FBC478/w/test/pylint/venv/lib/python3.10/site-packages/pylint/__init__.py", line 36, in run_pylint
    PylintRun(argv or sys.argv[1:])
  File "/run/media/reza/24B0FBEEB0FBC478/w/test/pylint/venv/lib/python3.10/site-packages/pylint/lint/run.py", line 169, in __init__
    args = _config_initialization(
  File "/run/media/reza/24B0FBEEB0FBC478/w/test/pylint/venv/lib/python3.10/site-packages/pylint/config/config_initialization.py", line 75, in _config_initialization
    parsed_args_list = linter._parse_command_line_configuration(args_list)
  File "/run/media/reza/24B0FBEEB0FBC478/w/test/pylint/venv/lib/python3.10/site-packages/pylint/config/arguments_manager.py", line 278, in _parse_command_line_configuration
    self.config, parsed_args = self._arg_parser.parse_known_args(
  File "/usr/lib/python3.10/argparse.py", line 1859, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/usr/lib/python3.10/argparse.py", line 2072, in _parse_known_args
    start_index = consume_optional(start_index)
  File "/usr/lib/python3.10/argparse.py", line 2012, in consume_optional
    take_action(action, args, option_string)
  File "/usr/lib/python3.10/argparse.py", line 1936, in take_action
    action(self, namespace, argument_values, option_string)
  File "/run/media/reza/24B0FBEEB0FBC478/w/test/pylint/venv/lib/python3.10/site-packages/pylint/config/callback_actions.py", line 286, in __call__
    print(self.run.linter._generate_config_file())
  File "/run/media/reza/24B0FBEEB0FBC478/w/test/pylint/venv/lib/python3.10/site-packages/pylint/config/arguments_manager.py", line 708, in _generate_config_file
    toml_doc.add(tomlkit.key(["tool", "pylint"]), pylint_tool_table)
  File "/run/media/reza/24B0FBEEB0FBC478/w/test/pylint/venv/lib/python3.10/site-packages/tomlkit/container.py", line 114, in add
    return self.append(key, item)
  File "/run/media/reza/24B0FBEEB0FBC478/w/test/pylint/venv/lib/python3.10/site-packages/tomlkit/container.py", line 157, in append
    self._handle_dotted_key(key, item)
  File "/run/media/reza/24B0FBEEB0FBC478/w/test/pylint/venv/lib/python3.10/site-packages/tomlkit/container.py", line 118, in _handle_dotted_key
    raise TOMLKitError("Can't add a table to a dotted key")
tomlkit.exceptions.TOMLKitError: Can't add a table to a dotted key

Expected behavior

toml config text

Pylint version

pylint 2.17.3
astroid 2.15.4
Python 3.10.10 (main, Mar  5 2023, 22:26:53) [GCC 12.2.1 20230201]

OS / Environment

No response

Additional dependencies

No response

@IamRezaMousavi IamRezaMousavi added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label May 5, 2023
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.17.4 milestone May 5, 2023
@Pierre-Sassoulas
Copy link
Member

Duplicate of #8632, we need to release the fix and we didn't.

@Pierre-Sassoulas Pierre-Sassoulas closed this as not planned Won't fix, can't repro, duplicate, stale May 5, 2023
@Pierre-Sassoulas Pierre-Sassoulas added Duplicate 🐫 Duplicate of an already existing issue and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels May 5, 2023
@Pierre-Sassoulas
Copy link
Member

The temporary fix is to pin "tomlkit>=0.10.1,<=0.11.7",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate 🐫 Duplicate of an already existing issue
Projects
None yet
Development

No branches or pull requests

2 participants