AAClause / BrailleExtender

NVDA add-on that improves braille support
https://andreabc.net/projects/NVDA_addons/BrailleExtender/
GNU General Public License v2.0
16 stars 17 forks source link

Major error when reading #51

Closed vincent-lg closed 4 years ago

vincent-lg commented 4 years ago

Hello,

Sorry to be the bearer of bad news. I noticed a scenario in which NVDA wasn't able to read anymore. Just pressing the arrow keys sent an error message to the log. I panicked, thinking it was due to Firefox's updates... but on disabling BrailleExtender addon, it works again.

To reproduce

  1. Go to https://www.python.org/downloads/release/python-382/
  2. Browse by titles (using h on my computer) until you see "Major new features of the 3.8 series, compared to 3.7", which should be a heading level 2.
  3. Press the down arrow key to read the first feature. And you shouldn't see it in Braille at least.

This happens if you are in the browser or if you copy/paste the webpage in notepad, which seems to indicate this error is triggered by "unicode recognition". We're in a list and I would guess the bullets used for the list create some kind of error.

Log output

Here's what my log says (I tried to extract the proper information).

ERROR - core.CorePump.run (12:19:39.018) - MainThread (9048):
errors in this core pump cycle
Traceback (most recent call last):
  File "core.pyc", line 517, in run
  File "braille.pyc", line 2216, in pumpAll
  File "braille.pyc", line 1952, in handlePendingCaretUpdate
  File "braille.pyc", line 1958, in _doCursorMove
  File "C:\Users\Admin\AppData\Roaming\nvda\addons\BrailleExtender\globalPlugins\brailleExtender\__init__.py", line 135, in update
    fn(self)
  File "braille.pyc", line 1044, in update
  File "C:\Users\Admin\AppData\Roaming\nvda\addons\BrailleExtender\globalPlugins\brailleExtender\patchs.py", line 139, in update
    if config.conf["brailleExtender"]["undefinedCharReprMethod"] in [configBE.CHOICE_liblouis, configBE.CHOICE_HUC8, configBE.CHOICE_HUC6, configBE.CHOICE_hex, configBE.CHOICE_dec, configBE.CHOICE_oct, configBE.CHOICE_bin]: undefinedCharProcess(self)
  File "C:\Users\Admin\AppData\Roaming\nvda\addons\BrailleExtender\globalPlugins\brailleExtender\patchs.py", line 213, in undefinedCharProcess
    ) for braillePos in allBraillePos}
  File "C:\Users\Admin\AppData\Roaming\nvda\addons\BrailleExtender\globalPlugins\brailleExtender\patchs.py", line 213, in <dictcomp>
    ) for braillePos in allBraillePos}
  File "C:\Users\Admin\AppData\Roaming\nvda\addons\BrailleExtender\globalPlugins\brailleExtender\utils.py", line 266, in getTextInBraille
    else: res = ''.join([chr(ord(ch)-0x8000+0x2800) for ch in louis.translateString(table, l, mode=louis.dotsIO)])
  File "louis\__init__.pyc", line 216, in translateString
RuntimeError: Can't translate: tables ['current'], inbuf b'\xe6(\x00\x00b\x00\x00\x00l\x00\x00\x00a\x00\x00\x00c\x00\x00\x00k\x00\x00\x00 \x00\x00\x00s\x00\x00\x00q\x00\x00\x00u\x00\x00\x00a\x00\x00\x00r\x00\x00\x00e\x00\x00\x00\xf4(\x00\x00', typeform None, mode 4
ERROR - core.CorePump.run (12:19:39.023) - MainThread (9048):
errors in this core pump cycle
Traceback (most recent call last):
  File "core.pyc", line 517, in run
  File "braille.pyc", line 2216, in pumpAll
  File "braille.pyc", line 1952, in handlePendingCaretUpdate
  File "braille.pyc", line 1957, in _doCursorMove
  File "braille.pyc", line 1457, in saveWindow
  File "braille.pyc", line 1234, in bufferPosToRegionPos
LookupError: No such position

Hope that helps!

AAClause commented 4 years ago

Hello, Can you update? I accidentally introduced this bug in the previous version. It should be fixed with the latest version. sorry for the inconvenience.

vincent-lg commented 4 years ago

For some reason my comment wasn't processed. I haven't been offered a new update yet (I'm running on the dev channel), but I'll tell you whenever this happens.

Thanks,

AAClause commented 4 years ago

Sorry, you are right. Indeed I left another bug. Now it should be fully fixed. Thanks.

vincent-lg commented 4 years ago

I'm sorry, I still have several errors, though the page I sent behaves a bit better (but still not perfectly). I'm experiencing the same errors when opening Thunderbird, switching to another app then coming back to Thunderbird. I say "Thunderbird", it happens in Firefox too. Here's a log example. Not sure if I should open a new issue but it seems to be the same, or a similar, problem:

error executing event: gainFocus on <NVDAObjects.Dynamic_OutlineItemRowWithFakeNavigationMozillaIAccessible object at 0x092B2CD0> with extra args of {}
Traceback (most recent call last):
  File "eventHandler.pyc", line 155, in executeEvent
  File "eventHandler.pyc", line 92, in __init__
  File "eventHandler.pyc", line 100, in next
  File "C:\Users\Admin\AppData\Roaming\nvda\addons\BrailleExtender\globalPlugins\brailleExtender\__init__.py", line 249, in event_gainFocus
    nextHandler()
  File "eventHandler.pyc", line 100, in next
  File "appModules\thunderbird.pyc", line 28, in event_gainFocus
  File "eventHandler.pyc", line 100, in next
  File "NVDAObjects\__init__.pyc", line 1103, in event_gainFocus
  File "braille.pyc", line 1905, in handleGainFocus
  File "braille.pyc", line 1910, in _doNewObject
  File "braille.pyc", line 1542, in getFocusContextRegions
  File "braille.pyc", line 633, in update
  File "C:\Users\Admin\AppData\Roaming\nvda\addons\BrailleExtender\globalPlugins\brailleExtender\patchs.py", line 139, in update
    if config.conf["brailleExtender"]["undefinedCharReprMethod"] in [configBE.CHOICE_liblouis, configBE.CHOICE_HUC8, configBE.CHOICE_HUC6, configBE.CHOICE_hex, configBE.CHOICE_dec, configBE.CHOICE_oct, configBE.CHOICE_bin]: undefinedCharProcess(self)
  File "C:\Users\Admin\AppData\Roaming\nvda\addons\BrailleExtender\globalPlugins\brailleExtender\patchs.py", line 213, in undefinedCharProcess
    ) for braillePos in allBraillePos}
  File "C:\Users\Admin\AppData\Roaming\nvda\addons\BrailleExtender\globalPlugins\brailleExtender\patchs.py", line 213, in <dictcomp>
    ) for braillePos in allBraillePos}
  File "C:\Users\Admin\AppData\Roaming\nvda\addons\BrailleExtender\globalPlugins\brailleExtender\utils.py", line 266, in getTextInBraille
    else: res = ''.join([chr(ord(ch)-0x8000+0x2800) for ch in louis.translateString(table, l, mode=louis.dotsIO)])
  File "louis\__init__.pyc", line 216, in translateString
RuntimeError: Can't translate: tables ['current'], inbuf b'\xe5(\x00\x00\x00(\x00\x00\xc0(\x00\x00', typeform None, mode 4

As you can see in my traceback, the gainFocus event is also used by the Mozilla Enhancer addon. Sometimes it's tricky to know where the problem comes from. However, it does seem to originate from BrailleExtender, or at least, not be handled properly there.

Happy Sunday, regardless of bugs,

AAClause commented 4 years ago

I released 2 versions in yesterday evening (in a short time). Are you on the commit: cc4a6c8 (cf. version)? Thanks again, and sorry for the mess introduced by #39 (feature still in beta).

vincent-lg commented 4 years ago

Apologies, I was on 6855e68 for some reason, I've updated again. I'll close this issue if the problem seems to be fixed.

vincent-lg commented 4 years ago

Thanks, the fix seems to work!