Skip to content

Error with last NVDA alpha #5

@CyrilleB79

Description

@CyrilleB79

Hi

When navigating in edit fields, I get the following error with last alpha (commit 40023954726e9b85225a3fb77c3545d8c6f753f1):

ERROR - scriptHandler.executeScript (10:59:24.684) - MainThread (2816):
error executing script: <bound method EditableText.script_caret_moveByCharacter of <NVDAObjects.Dynamic_EditableTextLogContainerIAccessibleEditWindowNVDAObject object at 0x1290AE50>> with gesture 'flèche droite'
Traceback (most recent call last):
  File "scriptHandler.py", line 295, in executeScript
    script(gesture)
  File "editableText.py", line 239, in script_caret_moveByCharacter
    self._caretMovementScriptHelper(gesture, textInfos.UNIT_CHARACTER)
  File "editableText.py", line 174, in _caretMovementScriptHelper
    self._caretScriptPostMovedHelper(unit,gesture,newInfo)
  File "NVDAObjects\behaviors.py", line 220, in _caretScriptPostMovedHelper
    super()._caretScriptPostMovedHelper(speakUnit, gesture, info)
  File "editableText.py", line 160, in _caretScriptPostMovedHelper
    speech.speakTextInfo(info, unit=speakUnit, reason=controlTypes.OutputReason.CARET)
  File "speech\speech.py", line 1248, in speakTextInfo
    speak(seq, priority=priority, suppressBlanks=suppressBlanks)
  File "C:\Users\Cyrille\AppData\Roaming\nvda\addons\instantTranslate\globalPlugins\instantTranslate\__init__.py", line 287, in _localSpeak
    self._speak(sequence, *args, **kwargs)
  File "C:\Users\Cyrille\AppData\Roaming\nvda\addons\speechHistory\globalPlugins\speechHistory.py", line 100, in mySpeak
    self.oldSpeak(sequence, *args, **kwargs)
  File "C:\Users\Cyrille\AppData\Roaming\nvda\addons\speechHistoryExplorer\globalPlugins\speechHistoryExplorer\__init__.py", line 138, in mySpeak
    self.oldSpeak(sequence, *args, **kwargs)
TypeError: new_speak() got an unexpected keyword argument 'suppressBlanks'

There are other running add-ons (and some of them patch speech.speak, but disabling yours fixes the issue.

It's very likely a consequence of #13483.

You should probably take and pass *args and **kwargs when patching a function.

It has not been expressed explicitly but I would say that it has been the usage that new optional parameters can be added to the signature of a function without breaking the API. If you disagree and feel that the API has been broken, feel free to discuss it with NVAccess and / or on the lists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions