Fix-up of #9843: Fixed an error preventing a failed copy operation from being reported [NVDA 2020.4beta1]#11959
Merged
Merged
Conversation
Contributor
|
@CyrilleB79 there are some unneeded commits here. |
…ation from being reported.
9129fb0 to
546e711
Compare
Contributor
Author
Thanks @lukaszgo1. The unneeded commits were coming from the rebase onto beta that I had not correctly done. |
Contributor
|
@CyrilleB79: I indeed carried over the previous construct without realizing it was wrong. Good catch, thanks! |
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.
PR made against beta branch since the PR it is fixing is not yet part of a stable release.
Cc @feerrenrut
Link to issue number:
None
Fix-up of #9843.
Summary of the issue:
When using
api.copyToClipwith new argumentnotify=True, if any call to the clipboard API fails, "Unable to copy" message should be reported since the merge of #9843. This is however not the case.It was discovered during my computer stress tests (for unrelated reasons). The stress tests consists in keeping NVDA+T pressed during a long time (30 seconds or one minute) in MS Word.
After a while, the clipboard is overflowed by API operations and become inaccessible. The following error is reported in the log:
As per #9843, "Unable to copy" should be reported in this case and no error should occur.
Description of how this pull request fixes the issue:
In
api.copyToClip, caughtOSErrorinstead of unappropriatedctypes.WinErrorwhich is a function.I have seen in NVDA code (probably Python 2 legacy code) that we use
WinErrorin this case.Anyway, Python doc tells us to use
OSError:In any case,
WinErrorandOSErrorare the same.Testing performed:
Tested with the same stress test that the failing copy is reported. Since many messages are reported and interrupted, I have heard only the beginning of the message that differs from the message reporting a successful copy. I have then checked this message in the log.
Known issues with pull request:
None
Change log entry:
Not needed since #9843 is not yet part of a stable release.
Cc @JulienCochuyt (author of #9843).