8000 bpo-38183: Test_idle ignores user config directory. by terryjreedy · Pull Request #16198 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-38183: Test_idle ignores user config directory. #16198

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

Merged
merged 7 commits into from
Sep 16, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
bpo-38183: Test-idle skips user config directory.
It no longer tries to create .idlerc or any files within.
Users must run IDLE to discover settings save problems.
  • Loading branch information
terryjreedy committed Sep 16, 2019
commit 778fba1bc6a1bee1a46ca729096b418d62a8eddc
6 changes: 4 additions & 2 deletions Lib/idlelib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def __init__(self, _utest=False):
def CreateConfigHandlers(self):
"Populate default and user config parser dictionaries."
idledir = os.path.dirname(__file__)
self.userdir = userdir = self.GetUserCfgDir()
self.userdir = userdir = '' if idlelib.testing else self.GetUserCfgDir()
for cfg_type in self.config_types:
self.defaultCfg[cfg_type] = IdleConfParser(
os.path.join(idledir, f'config-{cfg_type}.def'))
Expand Down Expand Up @@ -199,8 +199,10 @@ def GetUserCfgDir(self):
except OSError:
warn = ('\n Warning: unable to create user config directory\n' +
userDir + '\n Check path and permissions.\n Exiting!\n')
if not idlelib.testing:
try:
print(warn, file=sys.stderr)
except OSError:
pass
raise SystemExit
# TODO continue without userDIr instead of exit
return userDir
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Test-idle skips user config directory. It no longer tries to create .idlerc
or any files within. Users must run IDLE to discover settings save problems.
0