Catch exceptions when creating shortcuts#10875
Merged
Merged
Conversation
Wrap each call to create shortcut in a try block, on error try to create the shortcut without translation.
See test results for failed build of commit 0eba1aeb93 |
michaelDCurran
requested changes
Mar 15, 2020
michaelDCurran
left a comment
Member
There was a problem hiding this comment.
Lots of flake8 errors at the moment also.
| registerAddonFileAssociation(slaveExe) | ||
|
|
||
|
|
||
| def _updateShotcuts(NVDAExe, installDir, shouldCreateDesktopShortcut, slaveExe, startMenuFolder) -> None: |
Member
There was a problem hiding this comment.
Rename _updateShotcuts to _updateShortcuts please.
Flake8 was complaining about the code complexity, which I agreed with and could not bring myself to make flake8 ignore the function.
Contributor
Author
|
Since the linter was complaining about the complexity of the function, and I agree it was hard to read, I have re-worked it. The new function wraps the calls to create shortcut, falling back on the non-translated name / hotkey as necessary. |
michaelDCurran
approved these changes
Mar 17, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
fixes #5166
fixes #6326
Related, alternative approach: #10874
Summary of the issue:
The way that shortcuts are created (wsh) does not handle unicode characters. This results in the installer presenting an error.
Description of how this pull request fixes the issue:
Wrap each call to create shortcut in a try block, on error try to create the shortcut without translation.
Testing performed:
Manually replaced translated versions of the strings with unicode characters (including the hotkey).
Checked that an error is presented in the log, but the shortcut is still created.
Known issues with pull request:
Change log entry:
Section: New features, Changes, Bug fixes