Skip to content

Commit 9516210

Browse files
committed
Fix failed to read config file None when DEFAULT_CONFIG_FILE is corrupt
Fixes #3611
1 parent 148d570 commit 9516210

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

docs/changelog/3611.bugfix.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix ``None`` appearing as the config filename in error output
2+
when the user's default config file is corrupt. - by :user:`kurtmckee`

src/tox/config/cli/ini.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def __init__(self) -> None:
3939
if self.has_tox_section:
4040
self.ini = IniLoader(CORE, parser, overrides=[], core_section=CORE)
4141
except Exception as exception: # noqa: BLE001
42-
logging.error("failed to read config file %s because %r", config_file, exception) # noqa: TRY400
42+
logging.error("failed to read config file %s because %r", self.config_file, exception) # noqa: TRY400
4343
self.has_config_file = None
4444

4545
def get(self, key: str, of_type: type[Any]) -> Any:

0 commit comments

Comments
 (0)