[issue38183] test_idle fails on AMD64 FreeBSD CURRENT Shared 3.x: GetUserCfgDir() fails with PermissionError

Terry J. Reedy report at bugs.python.org
Mon Sep 16 15:30:58 EDT 2019


Terry J. Reedy <tjreedy at udel.edu> added the comment:

>From IDLE's viewpoint, the 2.7 failures are the same.  In current 3.x, GetUserCfgDir has

    warn = ('\n Warning: unable to create user config directory\n' +
            userDir + '\n Check path and permissions.\n Exiting!\n')
    if not idlelib.testing:
        print(warn, file=sys.stderr)
    raise SystemExit

In 2.7. the conditional clause is not there because idlelib.testing does not exist.  It was added to avoid 3.x regrtest resource-changed checks that either were not backported to 2.7 or are not triggered by the smaller 2.7 set of IDLE tests.

The irony of the failures is that the tests are carefully written to pass regardless of user config values, if any, and never alter them.  Only test_config and test_configdialog actually *need* to access the config machinery.  Other tests could mock idleConf.

PR 16198 has a minimal fix that works on my Windows machine.  A 2.7 backport, which must be manual, will require the addition of idlelib.testing and its setting it test_idle.  I will wait for passes from buildbots, not just the CI.

Followup issues:

0. For 'other tests', mock idleConf and run a bit faster.

1. If ignoring .idlerc this way works, simplify some of the tests by setting idlelib.testing to True instead of duplicating what IdleConf will now  do.

2. Minimally implement "# TODO continue without userDIr instead of exit".  Replace "raise SystemExit" with "return ''" and add warnings that configuration changes will disappear when exiting IDLE.

----------
stage: patch review -> commit review
type:  -> behavior
versions: +Python 2.7, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38183>
_______________________________________


More information about the Python-bugs-list mailing list