Skip to content

gh-58781: Do not exit IDLE if the user config directory cannot be created - #157636

Open
serhiy-storchaka wants to merge 3 commits into
python:mainfrom
serhiy-storchaka:gh-58781-user-cfg-dir
Open

serhiy-storchaka wants to merge 3 commits into
python:mainfrom
serhiy-storchaka:gh-58781-user-cfg-dir

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

If the home directory does not exist and .idlerc cannot be created in the current directory, GetUserCfgDir() raised SystemExit at import of idlelib.config, before Tk was available, with the explanation only on stderr, which is invisible with pythonw. The same happened in the user-code subprocess, which imports idlelib.config too, producing the "IDLE's subprocess didn't make connection" error from the report.

Now GetUserCfgDir() returns '' and IDLE runs as it does in testing mode: default settings, nothing saved. The problems (a nonexistent home directory, a directory that could not be created) are reported in the configuration warning shown after the root is created, together with other configuration problems.

The other parts of the issue are already fixed: os.path.expanduser() on Windows ignores HOME since 3.8 and the user directory is computed once and used consistently, and printing to a None stderr no longer raises.

Stacked on #157620.

🤖 Generated with Claude Code

An invalid color in a user highlight theme crashed the Settings dialog.
Now it is ignored with a warning and the default color is used instead.
…be created

IDLE now starts with default settings and shows a warning instead of
exiting silently when started with pythonw. This also fixes the failure
of the subprocess to connect in that case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant