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
$ radonTraceback (most recent call last): File "/workspace/.venv/bin/radon", line 8, in <module> sys.exit(main()) File "/workspace/.venv/lib/python3.9/site-packages/radon/__init__.py", line 10, in main from radon.cli import program, log_error File "/workspace/.venv/lib/python3.9/site-packages/radon/cli/__init__.py", line 90, in <module> _cfg = FileConfig() File "/workspace/.venv/lib/python3.9/site-packages/radon/cli/__init__.py", line 45, in __init__ self.file_cfg = self.file_config() File "/workspace/.venv/lib/python3.9/site-packages/radon/cli/__init__.py", line 85, in file_config config.read_dict(FileConfig.toml_config()) File "/usr/local/lib/python3.9/configparser.py", line 754, in read_dict self.set(section, key, value) File "/usr/local/lib/python3.9/configparser.py", line 1204, in set super().set(section, option, value) File "/usr/local/lib/python3.9/configparser.py", line 894, in set value = self._interpolation.before_set(self, section, option, File "/usr/local/lib/python3.9/configparser.py", line 402, in before_set raise ValueError("invalid interpolation syntax in %r at "ValueError: invalid interpolation syntax in "{'log_format': '%(asctime)s %(process)d %(levelname)s %(name)s:%(filename)s:%(lineno)d %(message)s'}" at position 17
To avoid this issue, it requires to replace log_format in pyproject.toml as following:
Thanks for raising this detailed issue @yukihiko-shinoda. This appears to be a Duplicate of #244.
I have opened a PR to resolve the issue (#252); it would be great if you could take a look to review the changes and provide any feedback.
In essence, the issue is a result of radon using a config parser that uses the '%' sign for inserting or substituting values from other keys and that radon passes the entire configuration file to the parser - as opposed to the radon section only.
If you are not not dependent on radon versions later than 6.0.0 (including pyproject.toml support for radon configuration), rolling back to 5.1.0 should resolve the issue for you until the PR is merged.
Radon reports
ValueError: invalid interpolation syntax
when use pytest log format with$()d
. But pytest official documentation uses$()d
:_pytest.logging — pytest documentation
How to reproduce
pyproject.toml
:To avoid this issue, it requires to replace
log_format
inpyproject.toml
as following:radon version: 6.0.1
When rollback to radon 5.1.0, it can be avoided.
Tested python version: 3.9.16
OS info:
The text was updated successfully, but these errors were encountered: