Skip to content

No longer fail to restart NVDA when running from sources and started given relative path to nvda.pyw#11904

Merged
michaelDCurran merged 1 commit into
nvaccess:masterfrom
lukaszgo1:fixRestartFromSourceWithRelativePath
Dec 7, 2020
Merged

No longer fail to restart NVDA when running from sources and started given relative path to nvda.pyw#11904
michaelDCurran merged 1 commit into
nvaccess:masterfrom
lukaszgo1:fixRestartFromSourceWithRelativePath

Conversation

@lukaszgo1

Copy link
Copy Markdown
Contributor

Link to issue number:

None

Summary of the issue:

When running nvda from sources using a relative path such as pythonw source\nvda.pyw NVDA failed to restart. This was caused by the fact that shellapi.ShellExecute executes given process using cwd as the directory from which the given command should be running and when NVDA starts it changes cwd to its own source directory.

Description of how this pull request fixes the issue:

When restarting NVDA globalVars.appdir is used as a directory from which new process should be started. While at it I've also made the restart code more compact by removing unneeded parameters from sys.argv. in a loop.

Testing performed:

with NVDA repository at d:\my_repos\nvda started NVDA with the following invocations and ensured it can be restarted successfully:

  • pythonw nvda.pyw from the source directory
  • pythonw source\nvda.pyw from the main directory of the repo

I've also ensured that binary version of NVDA can be restarted successfully with these changes.

Known issues with pull request:

None known

Change log entry:

I don't think changelog entry is needed here - this would affect only developers and this issue was present for a long time.

@michaelDCurran michaelDCurran left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good work. That has confused me as to why that did not work for years.

@michaelDCurran michaelDCurran merged commit 3737e3c into nvaccess:master Dec 7, 2020
@nvaccessAuto nvaccessAuto added this to the 2020.4 milestone Dec 7, 2020
@lukaszgo1 lukaszgo1 deleted the fixRestartFromSourceWithRelativePath branch December 7, 2020 08:29
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.

3 participants