Logging: No longer mark log messages from nvda.pyw as coming from external code when running from sources (#13827)
Summary of the issue:
When starting NVDA from sources messages logged from nvda.pyw are shown as external. Example message:
INFO - external:__main__ (17:20:02.477) - MainThread (4316):
Starting NVDA version source-master-b817b03
This is clearly wrong. The problem is caused by the trailing backslash added in bat scripts (%~dp0 is already terminated with one and adding a second backslash causes logHandler.isPathExternalToNVDA to 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 %~dp0 are inspected and trailing backslash is no longer added to the paths. To make logHandler.isPathExternalToNVDA more resilient to invalid paths the path is normalized before checking if it is the same as sys.path.