Skip to content

Ensure scratchpad dirs exist before adding them to module paths#9814

Merged
michaelDCurran merged 1 commit into
threshold_py3_stagingfrom
i9797
Jun 26, 2019
Merged

Ensure scratchpad dirs exist before adding them to module paths#9814
michaelDCurran merged 1 commit into
threshold_py3_stagingfrom
i9797

Conversation

@michaelDCurran

Copy link
Copy Markdown
Member

Link to issue number:

Fixes #9797
Replaces pr #9800

Summary of the issue:

System tests fail due to NVDA failing to start because an exception is raised in appModuleHandler.doesAppModuleExist.
The system tests enable NVDA's scratchpad dir, in order to load a globalPlugin and synthDriver. However, it does not necessarily create other scratchpad directories (such as appModules).
It seems that pkgutil.iter_imports emits a None object in place of any path in a module's __path__ that does not physically exist.
Although when creating the scratchpad dir from the GUI NVDA automatically creates the needed directories, it does not handle the situation where the scratchpad option has been enabled through some other way. NVDA should always ensure that the directories exist before adding them to a module's paths.

Description of how this pull request fixes the issue:

config.addConfigDirsToPythonPackagePath now creates any subdirs before adding them to the module's __path__ if they do not exist already.

Testing performed:

NVDA no longer fails to start if launched with the scratchpad option enabled but missing one or more subdirs in the scratchpad directory.

Known issues with pull request:

None.

Change log entry:

None.

@josephsl josephsl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, system tests passes. Thanks.

@michaelDCurran michaelDCurran merged commit 25eebe0 into threshold_py3_staging Jun 26, 2019
@nvaccessAuto nvaccessAuto added this to the 2019.3 milestone Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants