Skip to content

Comments

Merge beta to master#14334

Merged
seanbudd merged 11 commits intomasterfrom
beta
Nov 4, 2022
Merged

Merge beta to master#14334
seanbudd merged 11 commits intomasterfrom
beta

Conversation

@seanbudd
Copy link
Member

@seanbudd seanbudd commented Nov 4, 2022

Must be merge commit not squash merge

michaelDCurran and others added 11 commits November 4, 2022 08:20
…omtypes) come through NVDA's logger with no codepath. (#14317)

Partial fix for #14315

Summary of the issue:
If an exception is raised inside a comtypes event handler and is not caught, Many many log messages are logged by NVDA at level error, with each line of the multiple nested tracebacks being individually logged via standard error.
This is extremely noisy for the user, and the log output is very hard to read.

Some background:
To produce friendly module.class.function paths for NVDA's log messages, NVDA's logging code provides / generates a special 'codepath' attribute on its log erecords. However, as NVDA sets itself as the root logger, it also receives log messages from other libraries (E.g. comtypes). But these log messages don't come with the special 'codepath' record attribute, which is required by NVDA's log formatter.
Thus, if one of these log messages is produced, an internal logging error occurs (KeyError: codepath), and this is pushed out via standard error as the log message could not be written to the log. However, NVDA's redirects standard error back to the logger, logging each line of output as its own log message.
In this case then, What is logged is each separate line of the multiple nested tracebacks, including the actual exception in the comtypes UI Autpomation event handler, plus the logging error traceback itself, plus also a call stack for debugging.
In totally on average about 22 or so separate log messages for one error.

Description of user facing changes
If an error occurs in a comtypes event handler method, only one error will be written to the log rather than more than 20.

Description of development approach
Add code to NVDA's log formatter.format method which checks if the record does not contain a codepath attribute, and if so, produces a simple one from standard log record attributes. e.g. name and funcName.
After this change, raising Runtime error in the UI Automation handleAutomationEvent method produces just 1 much shorter and easier to read message.
Summary of the issue:
#14301 moved an api import from core.main as it was otherwise unused
#14050 introduced a usage of api to core.main to beta
This means that api was used without being imported on beta and master.

Description of user facing changes
None

Description of development approach
Fix import error
From translation svn revision: 70427

Authors:
Bernd Dorer <bdorer@mailbox.org>
David Parduhn <xkill85@gmx.net>
Rene Linke <rene.linke@hamburg.de>
Adriani Botez <adriani.botez@gmail.com>
Karl Eick <hozosch@web.de>
Robert Hänggi <aarjay.robert@gmail.com>
Astrid Waldschmetterling <a.r.waldschmetterling@gmx.de>

Stats:
2	2	source/locale/de/LC_MESSAGES/nvda.po
 1 file changed, 2 insertions(+), 2 deletions(-)
From translation svn revision: 70427

Authors:
Ali Aslani <aslani.ali@gmail.com>
Mohammadreza Rashad <mohammadreza5712@gmail.com>

Stats:
280	137	source/locale/fa/LC_MESSAGES/nvda.po
96	0	user_docs/fa/changes.t2t
 2 files changed, 376 insertions(+), 137 deletions(-)
From translation svn revision: 70427

Authors:
Hrvoje Katic <hrvojekatic@gmail.com>
Zvonimir Stanecic <9a5dsz@gozaltech.org>
Milo Ivir <mivir@milotype.de>
Dejana Rakic <dejana.rakic.2@gmail.com>

Stats:
5	5	source/locale/hr/LC_MESSAGES/nvda.po
 1 file changed, 5 insertions(+), 5 deletions(-)
From translation svn revision: 70427

Authors:
Simone Dal Maso <simone.dalmaso@gmail.com>
Alberto Buffolino <a.buffolino@gmail.com>

Stats:
95	97	user_docs/it/userGuide.t2t
 1 file changed, 95 insertions(+), 97 deletions(-)
From translation svn revision: 70427

Authors:
Takuya Nishimoto <nishimotz@gmail.com>
Minako Nonogaki <minakonono3519@gmail.com>

Stats:
269	41	user_docs/ja/userGuide.t2t
 1 file changed, 269 insertions(+), 41 deletions(-)
From translation svn revision: 70427

Authors:
Bram Duvigneau <bram@bramd.nl>
Bart Simons <bart@bartsimons.be>
A Campen <a.campen@wxs.nl>
Leonard de Ruijter <alderuijter@gmail.com>

Stats:
269	41	user_docs/nl/userGuide.t2t
 1 file changed, 269 insertions(+), 41 deletions(-)
From translation svn revision: 70427

Authors:
Grzegorz Zlotowicz <grzezlo@wp.pl>
Patryk Faliszewski <patric3031@wp.pl>
Zvonimir Stanecic <9a5dsz@gozaltech.org>
Dorota Krac <dorkakrac@yandex.com>
Piotr Rakowski <kontakt@piotrrakowski.net>
Hubert Meyer <hubmeyer1989@gmail.com>
Arkadiusz Swietnicki <nuno69a@gmail.com>

Stats:
110	0	user_docs/pl/changes.t2t
 1 file changed, 110 insertions(+)
From translation svn revision: 70427

Authors:
Cagri Dogan <cagrid@hotmail.com>

Stats:
11	11	source/locale/tr/LC_MESSAGES/nvda.po
62	9	user_docs/tr/changes.t2t
 2 files changed, 73 insertions(+), 20 deletions(-)
From translation svn revision: 70427
@seanbudd seanbudd requested a review from a team as a code owner November 4, 2022 02:19
@seanbudd seanbudd requested a review from feerrenrut November 4, 2022 02:19
@seanbudd seanbudd merged commit ec39083 into master Nov 4, 2022
@nvaccessAuto nvaccessAuto added this to the 2023.1 milestone Nov 4, 2022
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.

4 participants