CyrilleB79 / charInfo

This addon for NVDA screen reader provides detailed character information when pressing four times the review current character gesture.
GNU General Public License v2.0
1 stars 4 forks source link

Errors on different reporting of character name other than the english character name #13

Open Adriani90 opened 8 months ago

Adriani90 commented 8 months ago

I was playing with the settings of this add-on and tried to retrieve unicode names or CLDR names form i.e. mathematical alphanumeric characters. I get lots of errors as follows. Is this a limitation by tha databases of character names? Or is this possible to fix in this add-on?

Following are my test results:

Retrieving the detailed character name via the addon with numpad 2 twice:

1. Report CLDR local character name gives following error

IO - inputCore.InputManager.executeGesture (16:49:59.601) - winInputHook (7216): Input: kb(laptop):leftArrow DEBUG - editableText.EditableText._hasCaretMoved (16:49:59.616) - MainThread (1924): Caret move detected using event. Elapsed 0 sec, retries 0 IO - speech.speech.speak (16:49:59.655) - MainThread (1924): Speaking [CharacterModeCommand(True), '𝒸', EndUtteranceCommand()] IO - inputCore.InputManager.executeGesture (16:49:59.808) - winInputHook (7216): Input: kb(laptop):leftArrow DEBUG - editableText.EditableText._hasCaretMoved (16:49:59.824) - MainThread (1924): Caret move detected using event. Elapsed 0 sec, retries 0 IO - speech.speech.speak (16:49:59.846) - MainThread (1924): Speaking [CharacterModeCommand(True)DEBUG - watchdog._waitUntilNormalCoreAliveTimeout (16:50:04.142) - watchdog (21076): Potential freeze, waiting up to 10 seconds. INFO - watchdog.waitForFreezeRecovery (16:50:05.143) - watchdog (21076): Starting freeze recovery after 1.5007532000017818 seconds. DEBUGWARNING - watchdog.waitForFreezeRecovery (16:50:05.143) - watchdog (21076): Listing stacks for Python threads: Python stack for thread 17228 (synthDrivers._espeak.BgThread): File "threading.pyc", line 1002, in _bootstrap File "threading.pyc", line 1045, in _bootstrap_inner File "synthDrivers_espeak.pyc", line 201, in run File "queue.pyc", line 171, in get File "threading.pyc", line 327, in wait

Python stack for thread 16076 (watchdog.CancellableCallThread.execute(<CFunctionType object at 0x05DDF468>)): File "threading.pyc", line 1002, in _bootstrap File "threading.pyc", line 1045, in _bootstrap_inner File "watchdog.pyc", line 382, in run File "threading.pyc", line 629, in wait File "threading.pyc", line 327, in wait

Python stack for thread 10128 (visionEnhancementProviders.NVDAHighlighter.NVDAHighlighter): File "threading.pyc", line 1002, in _bootstrap File "threading.pyc", line 1045, in _bootstrap_inner File "threading.pyc", line 982, in run File "visionEnhancementProviders\NVDAHighlighter.pyc", line 454, in _run File "windowUtils.pyc", line 274, in _rawWindowProc File "visionEnhancementProviders\NVDAHighlighter.pyc", line 139, in windowProc File "visionEnhancementProviders\NVDAHighlighter.pyc", line 177, in _paint File "contextlib.pyc", line 137, in enter File "winUser.pyc", line 762, in paint File "windowUtils.pyc", line 279, in _rawWindowProc

Python stack for thread 21076 (watchdog): File "threading.pyc", line 1002, in _bootstrap File "threading.pyc", line 1045, in _bootstrap_inner File "threading.pyc", line 982, in run File "watchdog.pyc", line 159, in _watcher File "watchdog.pyc", line 166, in waitForFreezeRecovery File "logHandler.pyc", line 64, in getFormattedStacksForAllThreads

Python stack for thread 7216 (winInputHook): File "threading.pyc", line 1002, in _bootstrap File "threading.pyc", line 1045, in _bootstrap_inner File "threading.pyc", line 982, in run File "winInputHook.pyc", line 81, in hookThreadFunc

Python stack for thread 23196 (UIAHandler.UIAHandler.MTAThread): File "threading.pyc", line 1002, in _bootstrap File "threading.pyc", line 1045, in _bootstrap_inner File "threading.pyc", line 982, in run File "UIAHandler__init__.pyc", line 534, in MTAThreadFunc File "queue.pyc", line 171, in get File "threading.pyc", line 327, in wait

Python stack for thread 10096 (ThreadPoolExecutor-0_0): File "threading.pyc", line 1002, in _bootstrap File "threading.pyc", line 1045, in _bootstrap_inner File "threading.pyc", line 982, in run File "concurrent\futures\thread.pyc", line 81, in _worker

Python stack for thread 7040 (hwIo.ioThread.IoThread): File "threading.pyc", line 1002, in _bootstrap File "threading.pyc", line 1045, in _bootstrap_inner File "hwIo\ioThread.pyc", line 258, in run

Python stack for thread 1924 (MainThread): File "nvda.pyw", line 399, in File "core.pyc", line 892, in main File "wx\core.pyc", line 2262, in MainLoop File "wx\core.pyc", line 3427, in File "core.pyc", line 822, in processRequest File "core.pyc", line 838, in Notify File "queueHandler.pyc", line 97, in pumpAll File "queueHandler.pyc", line 64, in flushQueue File "scriptHandler.pyc", line 243, in _queueScriptCallback File "keyboardHandler.pyc", line 571, in executeScript File "inputCore.pyc", line 222, in executeScript File "scriptHandler.pyc", line 295, in executeScript File "gui\blockAction.pyc", line 72, in funcWrapper File "globalCommands.pyc", line 2858, in script_navigatorObject_devInfo File "logging__init__.pyc", line 1489, in info File "logHandler.pyc", line 237, in _log


2.  Report the CLDR English name of the character gives following error:

Input: kb(laptop):rightArrow DEBUG - editableText.EditableText._hasCaretMoved (16:51:41.406) - MainThread (1924): Caret move detected using bookmarks. Elapsed 0 sec, retries 0 IO - speech.speech.speak (16:51:41.437) - MainThread (1924): Speaking [CharacterModeCommand(True), '𝑜', EndUtteranceCommand()] IO - inputCore.InputManager.executeGesture (16:51:41.693) - winInputHook (7216): Input: kb(laptop):rightArrow DEBUG - editableText.EditableText._hasCaretMoved (16:51:41.701) - MainThread (1924): Caret move detected using event. Elapsed 0 sec, retries 0 IO - speech.speech.speak (16:51:41.725) - MainThread (1924): Speaking [CharacterModeCommand(True), '𝒸', EndUtteranceCommand()] IO - inputCore.InputManager.executeGesture (16:51:43.142) - winInputHook (7216): Input: kb(laptop):NVDA+. IO - speech.speech.speak (16:51:43.240) - MainThread (1924): Speaking [CharacterModeCommand(True), '𝒸', EndUtteranceCommand()] IO - inputCore.InputManager.executeGesture (16:51:43.292) - winInputHook (7216): Input: kb(laptop):NVDA+. ERROR - scriptHandler.executeScript (16:51:43.295) - MainThread (1924): error executing script: <bound method GlobalPlugin.script_review_currentCharacter of GlobalPlugin ('globalPlugins.charinfo')> with gesture 'NVDA+.' Traceback (most recent call last): File "C:\Users\adria\AppData\Roaming\nvda\addons\charInfo\globalPlugins\charinfo__init__.py", line 598, in getCldrNameValue return data.symbols[self.text].replacement


KeyError: '𝒸'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "scriptHandler.pyc", line 295, in executeScript
  File "C:\Users\adria\AppData\Roaming\nvda\addons\charInfo\globalPlugins\charinfo\__init__.py", line 1249, in script_review_currentCharacter
    reportFunction(info)
  File "C:\Users\adria\AppData\Roaming\nvda\addons\charInfo\globalPlugins\charinfo\__init__.py", line 1139, in speakCLDREnglishName
    speakCLDRName(info, lang='en')
  File "C:\Users\adria\AppData\Roaming\nvda\addons\charInfo\globalPlugins\charinfo\__init__.py", line 1134, in speakCLDRName
    ', '.join(c.getCldrNameValue(lang=lang, fallbackToEnglish=True) for c in allChars.charList)
  File "C:\Users\adria\AppData\Roaming\nvda\addons\charInfo\globalPlugins\charinfo\__init__.py", line 1134, in <genexpr>
    ', '.join(c.getCldrNameValue(lang=lang, fallbackToEnglish=True) for c in allChars.charList)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\adria\AppData\Roaming\nvda\addons\charInfo\globalPlugins\charinfo\__init__.py", line 600, in getCldrNameValue
    raise NoValueError(f'text={self.text}; lang={lang}')
globalPlugins.charinfo.NoValueError: text=𝒸; lang=en
IO - inputCore.InputManager.executeGesture (16:51:46.196) - winInputHook (7216):INFO - globalCommands.script_navigatorObject_devInfo (16:51:46.255) - MainThread (1924):
```

3.  Report the Unicodedata local name of character gives following error:
```
IO - inputCore.InputManager.executeGesture (16:53:54.480) - winInputHook (7216):
Input: kb(laptop):rightArrow
DEBUG - editableText.EditableText._hasCaretMoved (16:53:54.485) - MainThread (1924):
Caret move detected using bookmarks. Elapsed 0 sec, retries 0
IO - speech.speech.speak (16:53:54.506) - MainThread (1924):
Speaking [CharacterModeCommand(True), '𝑜', EndUtteranceCommand()]
DEBUG - UIAHandler.shouldUseUIAInMSWord (16:53:54.540) - MainThread (1924):
User does not want UIA in MS Word unless necessary
IO - inputCore.InputManager.executeGesture (16:53:55.636) - winInputHook (7216):
Input: kb(laptop):NVDA+.
IO - speech.speech.speak (16:53:55.715) - MainThread (1924):
Speaking [CharacterModeCommand(True), '𝑜', EndUtteranceCommand()]
IO - inputCore.InputManager.executeGesture (16:53:55.766) - winInputHook (7216):
Input: kb(laptop):NVDA+.
ERROR - scriptHandler.executeScript (16:53:55.775) - MainThread (1924):
error executing script: <bound method GlobalPlugin.script_review_currentCharacter of GlobalPlugin ('globalPlugins.charinfo')> with gesture 'NVDA+.'
Traceback (most recent call last):
  File "scriptHandler.pyc", line 295, in executeScript
  File "C:\Users\adria\AppData\Roaming\nvda\addons\charInfo\globalPlugins\charinfo\__init__.py", line 1249, in script_review_currentCharacter
    reportFunction(info)
  File "C:\Users\adria\AppData\Roaming\nvda\addons\charInfo\globalPlugins\charinfo\__init__.py", line 1128, in speakCharacterLocaleName
    speakCharacterName(info, lang=languageHandler.getLanguage())
  File "C:\Users\adria\AppData\Roaming\nvda\addons\charInfo\globalPlugins\charinfo\__init__.py", line 1120, in speakCharacterName
    speech.speakMessage(', '.join(c.getNameValue(lang=lang, fallbackToEnglish=True) for c in allChars.charList))
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: sequence item 0: expected str instance, NoneType found
IO - inputCore.InputManager.executeGesture (16:53:57.397) - winInputHook (7216INFO - globalCommands.script_navigatorObject_devInfo (16:53:57.465) - MainThread (1924):
```

4.  Report the Unicodedata english name of the character works as expected, NVDA reports i.e. “mathematical script capital j”

5.  Report Microsoft proprietary font character (name, font, equivalent Unicode name) does not work. NVDA reports just the character (i.e. 𝒥)
CyrilleB79 commented 8 months ago

Hi @Adriani90

Thanks for reporting all these issues.

I'll have a look when I can. But can you already provide the following answers:

Thanks.

Adriani90 commented 8 months ago

@CyrilleB79 thank you very much. Here are my answers:

Regarding MS font information, it only reports useful information when you are on a character in MS font, e.g. in Word on a character in Windings font. Thanks for the explanation, that is good to know. when there is no useful information to report, what would you advise to report?

  1. For character names not available in local language: "not available in {x} language"

Moreover, when Microsoft proprietary font character (name, font, equivalent Unicode name) has been set explicitely by the user:

  1. For charaters other than MS font: "not a MS font character"
  2. For MS Font characters without a name available: "character name not available"