Logging: No longer mark log messages from nvda.pyw as coming from external code when running from sources#13827
Merged
Conversation
seanbudd
reviewed
Jun 22, 2022
ab9dce6 to
c4b6508
Compare
Contributor
Author
|
@seanbudd I agree that these extra backslashes in scripts make the code more readable, however they are also shown in the console when running these bat files, + paths with multiple backslashes are non standard. I've modified the code so that the extra backslash is stripped from the paths - let me know if this makes things better. |
seanbudd
reviewed
Jun 27, 2022
| call "%~dp0\venvUtils\venvCmd.bat" py "%~dp0\tests\lint\genDiff.py" %1 "%~dp0\tests\lint\_lint.diff" | ||
| set hereOrig=%~dp0 | ||
| set here=%hereOrig% | ||
| if #%hereOrig:~-1%# == #\# set here=%hereOrig:~0,-1% |
Contributor
Author
There was a problem hiding this comment.
It strips the backslash from the path of the current directory if it ends with one.
seanbudd
approved these changes
Jun 27, 2022
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:
None
Summary of the issue:
When starting NVDA from sources messages logged from nvda.pyw are shown as external. Example message:
This is clearly wrong. The problem is caused by the trailing backslash added in bat scripts (
%~dp0is already terminated with one and adding a second backslash causeslogHandler.isPathExternalToNVDAto think that the path is external).Description of user facing changes
Log messages from nvda.pyw are no longer marked as external.
Description of development approach
All usages of
%~dp0are inspected and trailing backslash is no longer added to the paths. To makelogHandler.isPathExternalToNVDAmore resilient to invalid paths the path is normalized before checking if it is the same assys.path.Testing strategy:
Known issues with pull request:
None known
Change log entries:
None needed - affects only logging from source copies.
Code Review Checklist: