internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: nvaccess/nvda

Issue:
Double pressing cursor routing button on "lnk" in browse mode doesn't activate it
### Steps to reproduce:
1. In any browser, go into browse mode and position the cursor on a link.
2. Press the cursor routing button on a braille display above the control type label "lnk".
3. If the cursor wasn't on the first character of the link, it will now be moved there. In that case, repeat step 2.

### Expected behavior:
The link is activated.

### Actual behavior:
The cursor is routed if it is not already positioned at the start of the link, but the link is not activated when pressed again. The same for buttons and other controls.

### System configuration:
NVDA version: master-14219,24cc3204
NVDA Installed or portable: Installed

### Technical:
I suspect `braille.TextInfoRegion.routeTo`. The control type label can't be routed to but shares the same start position as the content following it.


Discussion:
To be clear: double routing anywhere in the link text does activate it. Routing once on the label "lnk" outside browse mode also activates it.
I would say P3 because this is very minor, but will become more relevant with #6802.

Resolving patch:
diff --git a/source/braille.py b/source/braille.py
--- a/source/braille.py
+++ b/source/braille.py
@@ -1087,7 +1087,9 @@ def routeTo(self, braillePos):
 			brailleInput.handler.updateDisplay()
 			return
 
-		if braillePos == self.brailleCursorPos:
+		dest = self.getTextInfoForBraillePos(braillePos)
+		cursor = self.getTextInfoForBraillePos(self.brailleCursorPos)
+		if dest.compareEndPoints(cursor, "startToStart") == 0:
 			# The cursor is already at this position,
 			# so activate the position.
 			try:
@@ -1095,7 +1097,6 @@ def routeTo(self, braillePos):
 			except NotImplementedError:
 				pass
 			return
-		dest = self.getTextInfoForBraillePos(braillePos)
 		self._setCursor(dest)
 
 	def nextLine(self):


Test patch:
Repository: nvaccess/nvda

Issue:
Dev docs: globalVars.appDir is not defined when attempting to build docs with Sphinx
Hi,
Related to #11970 and actually blocks it:

### Steps to reproduce:
When trying to build dev docs using "scons devDocs":

1. Run scons devDocs.
2. Once Sphinx is instlaled and ready, Sphinx will try to build dev docs for the source code.

### Actual behavior:
A traceback shows up, ending with:
AttributeError: module 'globalVars' has no attribute 'appDir'

### Expected behavior:
No errors with the dev docs building completing.

### System configuration
#### NVDA installed/portable/running from source:
Source

#### NVDA version:
Alpha-21561,7e5ffde2391c

#### Windows version:
Windows 10 Version 20H2 (build 19042.685)

#### Name and version of other software in use when reproducing the issue:
Python 3.7.9

#### Other information about your system:
N/A

### Other questions
#### Does the issue still occur after restarting your computer?
Yes

#### Have you tried any other versions of NVDA? If so, please report their behaviors.
Not applicable

#### If addons are disabled, is your problem still occurring?
Not applicable

#### Did you try to run the COM registry fixing tool in NVDA menu / tools?
Not applicable

### Cause:
This is caused by config file error, specifically when a mock config.conf instance is created. Prior to this, importing config module fails because globalVars.appDir is not defined by the time scons devDocs is run.

### Solution:
one solution is to define globalVars.appDir to point to the source directory.

Thanks.


Discussion:

Resolving patch:
diff --git a/devDocs/conf.py b/devDocs/conf.py
--- a/devDocs/conf.py
+++ b/devDocs/conf.py
@@ -1,5 +1,5 @@
 # A part of NonVisual Desktop Access (NVDA)
-# Copyright (C) 2019 NV Access Limited, Leonard de Ruijter
+# Copyright (C) 2019-2020 NV Access Limited, Leonard de Ruijter, Joseph Lee
 # This file is covered by the GNU General Public License.
 # See the file COPYING for more details.
 
@@ -16,7 +16,7 @@
 import languageHandler  # noqa: E402
 languageHandler.setLanguage("en")
 
-# Initialize globalvars.appArgs to something sensible.
+# Initialize globalVars.appArgs to something sensible.
 import globalVars  # noqa: E402
 
 
@@ -30,6 +30,11 @@ class AppArgs:
 
 
 globalVars.appArgs = AppArgs()
+# #11971: NVDA is not running, therefore app dir is undefined.
+# Therefore tell NVDA that apt source directory is app dir.
+appDir = os.path.join("..", "source")
+globalVars.appDir = os.path.abspath(appDir)
+
 
 # Import NVDA's versionInfo module.
 import versionInfo  # noqa: E402


Test patch:
Repository: nvaccess/nvda

Issue:
Unexpected empty lines in browseable messages (e.g. formatting information)
### Steps to reproduce:

* set the cursor or virtual cursor on a text having formatting information such as text in a web page
* Press two times quickly NVDA+F to get formatting info in a browseable window
* Examine the formatting information line by line by pressing down arrow many times

Extra:
* Open the Python console and type:
  `import ui;ui.browseableMessage("Hello\nworld")
`

### Actual behavior:

NVDA reads "blank" one line in two in formatting info as well as in "Hello world" message.


### Expected behavior:

NVDA should not read "blank" between formatting information line nor in "Hello world" message since:
* As a user, we do not need blank lines to examine a text such as formatting information
* Visually, there is no blank line
* The source string of the "Hello world" message does not contain any blank line.

### System configuration
#### NVDA installed/portable/running from source:
all
#### NVDA version:
2020.4beta4
#### Windows version:
10
#### Name and version of other software in use when reproducing the issue:
N/A
#### Other information about your system:
N/A
### Other questions
#### Does the issue still occur after restarting your computer?
Yes
#### Have you tried any other versions of NVDA? If so, please report their behaviors.
Yes, 2020.3: same issue.
It seems to me that this issue has always been there.
#### If addons are disabled, is your problem still occuring?
Yes
#### Did you try to run the COM registry fixing tool in NVDA menu / tools?
No



Discussion:

Resolving patch:
diff --git a/source/ui.py b/source/ui.py
--- a/source/ui.py
+++ b/source/ui.py
@@ -15,6 +15,7 @@
 from ctypes import windll, byref, POINTER, addressof
 from comtypes import IUnknown
 from comtypes import automation 
+from html import escape
 from logHandler import log
 import gui
 import speech
@@ -55,8 +56,9 @@ def browseableMessage(message,title=None,isHtml=False):
 	if not title:
 		# Translators: The title for the dialog used to present general NVDA messages in browse mode.
 		title = _("NVDA Message")
-	isHtmlArgument = "true" if isHtml else "false"
-	dialogString = u"{isHtml};{title};{message}".format( isHtml = isHtmlArgument , title=title , message=message ) 
+	if not isHtml:
+		message = f"<pre>{escape(message)}</pre>"
+	dialogString = f"{title};{message}"
 	dialogArguements = automation.VARIANT( dialogString )
 	gui.mainFrame.prePopup() 
 	windll.mshtml.ShowHTMLDialogEx( 


Test patch:
Repository: nvaccess/nvda

Issue:
Python 3.8: add NVDA source directory when attempting to import liblouis DLL
Hi,

A variation for #10385 

### Is your feature request related to a problem? Please describe.
Python 3.8 adds os.add_dll_directory function that takes path string. This is done for security reasons, as Python's DLL path lookup routine has changed. This affects all sorts of DLL's, including NVDA Helper (see #10385) and for this one, liblouis.dll.

### Describe the solution you'd like
Use os.add_dll_directory function right before importing liblouis.dll in lous helper module.

### Describe alternatives you've considered
Leave it as is, although it breaks Python 3.8 compatibility.

### Additional context
See #10384 for details.



Discussion:
I thought it was unlikely that an update to this version was actually 
planned. Certainly some add ons show a flagged error if that runtime is 
going to be used now, even python 3 ready ones.
 Brian


bglists@blueyonder.co.uk
Sent via blueyonder.
Please address personal E-mail to:-
briang1@blueyonder.co.uk, putting 'Brian Gaff'
in the display name field.
Newsgroup monitored: alt.comp.blind-users 


Hi,

Eventually we will move onto a future Python release which will include this function, so we might as well start noting some things here and there.

Thanks.

Resolving patch:
diff --git a/source/louisHelper.py b/source/louisHelper.py
--- a/source/louisHelper.py
+++ b/source/louisHelper.py
@@ -1,12 +1,16 @@
-#louisHelper.py
-#A part of NonVisual Desktop Access (NVDA)
-#This file is covered by the GNU General Public License.
-#See the file COPYING for more details.
-#Copyright (C) 2018 NV Access Limited, Babbage B.V.
+# A part of NonVisual Desktop Access (NVDA)
+# This file is covered by the GNU General Public License.
+# See the file COPYING for more details.
+# Copyright (C) 2018-2021 NV Access Limited, Babbage B.V., Joseph Lee
 
 """Helper module to ease communication to and from liblouis."""
 
-import louis
+# Python 3.8 changes the way DLL's are loaded due to security.
+# Thus manually add NVDA executable path to DLL lookup path for loading liblouis.dll.
+import os
+import globalVars
+with os.add_dll_directory(globalVars.appDir):
+	import louis
 from logHandler import log
 import config
 


Test patch:
Repository: nvaccess/nvda

Issue:
nvda does not read the list of attachments in outlook 

### Steps to reproduce:
open an email in outlook that has an attachment.
Press shift + tabe to focus on the list of attachments 
### Actual behavior:
nvda does not speak, just an error sound 
### Expected behavior:
nvda should read the name of the attachments 
### System configuration
#### NVDA installed/portable/running from source:
instaled
#### NVDA version:
nvda.exe, NVDA alpha-22222,2e37433e

#### Windows version:
10 19043.906
#### Name and version of other software in use when reproducing the issue:
OUTLOOK.EXE, Microsoft Outlook 16.0.13801.20360

#### Other information about your system:

### Other questions
#### Does the issue still occur after restarting your computer?
yes
#### Have you tried any other versions of NVDA? If so, please report their behaviors.
yes
I noticed the mistakes in the last alphas, I can't speak from which 
#### If add-ons are disabled, is your problem still occurring?
yes
#### Did you try to run the COM registry fixing tool in NVDA menu / tools?
no
log:
[outlook.txt](https://github.com/nvaccess/nvda/files/6251782/outlook.txt)



Discussion:
Reproduced also on my side on 2 computers.

The regression seems to have appeared with #12210.
Cc @michaelDCurran, author of this PR.

Hello. I also confirm this. . I think the problem also affects some windows settings. there, too, there was a regression.

Resolving patch:
diff --git a/source/NVDAObjects/UIA/__init__.py b/source/NVDAObjects/UIA/__init__.py
--- a/source/NVDAObjects/UIA/__init__.py
+++ b/source/NVDAObjects/UIA/__init__.py
@@ -1217,6 +1217,10 @@ def _get_selectionContainer(self) -> "typing.Optional[UIA]":
 		if not p:
 			return None
 		e = p.currentSelectionContainer
+		if not e:
+			# Some implementations of SelectionItemPattern, such as the Outlook attachment list
+			# give back a NULL selectionContainer
+			return None
 		e = e.buildUpdatedCache(UIAHandler.handler.baseCacheRequest)
 		obj = UIA(UIAElement=e)
 		if obj.UIASelectionPattern2:


Test patch:
Repository: nvaccess/nvda

Issue:
GUI：UI issues introduced by Python 3.8 
UI issues introduced by Python 3.8 

### Python 3.7 behavior:

1.Center the screen of the update window 
2.The update time prompt is located above the progress bar
3.Set the panel cursor to be uniformly dark blue

![3](https://user-images.githubusercontent.com/59390108/112843116-d53ddd80-90d4-11eb-9be5-4d8fbdae77cb.PNG)

![1](https://user-images.githubusercontent.com/59390108/112843163-e0910900-90d4-11eb-8e18-9bcba76e5b31.PNG)

### Python 3.8   behavior:

1.The update window is located in the upper left corner of the screen
2.The update time prompt is located below the progress bar 
3.The cursor color of the setting control panel is inconsistent. They are dark blue and light blue.

![4](https://user-images.githubusercontent.com/59390108/112843251-f7cff680-90d4-11eb-8e74-d4e6cf8b2faf.PNG)


![2](https://user-images.githubusercontent.com/59390108/112843427-2352e100-90d5-11eb-88c4-b7e036435674.PNG)


### System configuration
#### NVDA installed/portable/running from source:

 installed/portable

#### NVDA version:

alpha-22160 and nvda2020.3

#### Windows version:

Windows10 pro 20H2 x64

#### Name and version of other software in use when reproducing the issue:

no 

#### Other information about your system:

no

### Other questions
#### Does the issue still occur after restarting your computer?

Yes

#### If add-ons are disabled, is your problem still occurring?

Yes

#### Did you try to run the COM registry fixing tool in NVDA menu / tools?

Yes



Discussion:
Hello. in the latest alpha versions I've discovered a great retres availability. basically it's squinting at system interfaces. For example. nvda does not now announce an update when downloading and installing. There's been no problem with that before.
@lijianwei2019  Can you expand on how these changes impact you or others? 

The location of the update dialog is clearly a regression.
@feerrenrut 
Break the original UI style
Ok. As part of the recent updates, wxPython was updated. I suspect that some more modern controls are used which will explain some changes. Unless the changes cause a specific problem, I don't think they need attention.
@CyrilleB79 @JulienCochuyt

Resolving patch:
diff --git a/source/updateCheck.py b/source/updateCheck.py
--- a/source/updateCheck.py
+++ b/source/updateCheck.py
@@ -610,6 +610,7 @@ def start(self):
 			# and waits for the user to press the Close button.
 			style=wx.PD_CAN_ABORT | wx.PD_ELAPSED_TIME | wx.PD_REMAINING_TIME | wx.PD_AUTO_HIDE,
 			parent=gui.mainFrame)
+		self._progressDialog.CentreOnScreen()
 		self._progressDialog.Raise()
 		t = threading.Thread(
 			name=f"{self.__class__.__module__}.{self.start.__qualname__}",


Test patch:
Repository: nvaccess/nvda

Issue:
Exception when trying to interact with a text box in Firefox that isn't focused
### Steps to reproduce:
1. Open this URL in Firefox:
    `data:text/html,<input><button>hi</button>`
2. Tab until the button is focused.
3. Move to the previous navigator object (desktop NVDA+numpad4, laptop NVDA+shift+leftArrow)

### Actual behavior:
No speech and this exception:
```
ERROR - scriptHandler.executeScript (09:05:07.874) - MainThread (18464):
error executing script: <bound method GlobalCommands.script_navigatorObject_previous of <globalCommands.GlobalCommands object at 0x03E03B50>> with gesture 'NVDA+numpad 4'
Traceback (most recent call last):
  File "scriptHandler.pyc", line 208, in executeScript
  File "globalCommands.pyc", line 1177, in script_navigatorObject_previous
  File "speech\__init__.pyc", line 478, in speakObject
  File "speech\__init__.pyc", line 528, in getObjectSpeech
  File "documentBase.pyc", line 24, in makeTextInfo
  File "NVDAObjects\IAccessible\ia2TextMozilla.pyc", line 121, in __init__
  File "NVDAObjects\IAccessible\ia2TextMozilla.pyc", line 173, in _getSelectionBase
  File "NVDAObjects\IAccessible\ia2TextMozilla.pyc", line 183, in _makeRawTextInfo
  File "textInfos\offsets.pyc", line 472, in __init__
  File "NVDAObjects\IAccessible\__init__.pyc", line 202, in _getSelectionOffsets
  File "NVDAObjects\IAccessible\__init__.pyc", line 188, in _getCaretOffset
RuntimeError: no active caret in this object
```

### Expected behavior:
NVDA should say: "edit blank"

### System configuration
#### NVDA installed/portable/running from source:
Installed

#### NVDA version:
alpha-21810,db664bef

#### Windows version:
Win 10 Version 20H2 (OS Build 19042.782)

#### Name and version of other software in use when reproducing the issue:
Firefox Nightly 88.0a1 (2021-03-03) (64-bit)

### More Info
This regression was introduced in 65c5b5914d921e20129d4906bf8b7f8218cda1cb. I think the issue is that in Firefox, when an object isn't focused, it has no caret, so the TextInfo throws a RuntimeError. We previously caught all exceptions when trying to get the selection. Now, we only catch NotImplementedError.

This doesn't happen in Chromium because Chromium seems to maintain a caret (at least for a11y) even when the object isn't focused.

CC @MichaelDCurran.


Discussion:
cc: @feerrenrut 

Resolving patch:
diff --git a/source/speech/__init__.py b/source/speech/__init__.py
--- a/source/speech/__init__.py
+++ b/source/speech/__init__.py
@@ -568,7 +568,7 @@ def getObjectSpeech(  # noqa: C901
 	if shouldReportTextContent:
 		try:
 			info = obj.makeTextInfo(textInfos.POSITION_SELECTION)
-		except NotImplementedError:
+		except (NotImplementedError, RuntimeError):
 			info = None
 		if info and not info.isCollapsed:
 			# if there is selected text, then there is a value and we do not report placeholder


Test patch:
Repository: nvaccess/nvda

Issue:
when creating a portable copy of nvda the installed copy is turned off 

### Steps to reproduce:
start an installed copy of nvda.
now using the create portable copy item in the nvda tools menu
create a portable copy, make sure the checkboxes:
copy current user settings is checked
start port copy after creation is cleared 
### Actual behavior:
when the portable copy is created the installed nvda is closed 
### Expected behavior:
when the portable copy is created the installed nvda continues to run 
### System configuration
#### NVDA installed/portable/running from source:
instaled
#### NVDA version:
nvda.exe, NVDA alpha-22877,9a285153

#### Windows version:
19043.1021
#### Name and version of other software in use when reproducing the issue:

#### Other information about your system:

### Other questions
#### Does the issue still occur after restarting your computer?
yes
#### Have you tried any other versions of NVDA? If so, please report their behaviors.
no
#### If add-ons are disabled, is your problem still occurring?
yes
#### Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?
yes


Discussion:
I did not test on last alpha.
But testing on 2020.4, I can say that this issue is not present in 2020.4.

@fernando-jose-silva do you have the opportunity to test on 2020.4 to confirm what I am writing?

@seanbudd, @feerrenrut:
It seems this one should be integrated in 2021.1.


thanks in 2020.4 the problem does not occur
I tested it with Alpha-22877 and it can be reproduced. I think this should be fixed in 2020.1.
Thanks.

Resolving patch:
diff --git a/source/gui/installerGui.py b/source/gui/installerGui.py
--- a/source/gui/installerGui.py
+++ b/source/gui/installerGui.py
@@ -482,4 +482,5 @@ def doCreatePortable(portableDirectory,copyUserConfig=False,silent=False,startAf
 			def startNewPortableNVDAInstance():
 				_startNewNVDAInstance(portableDirectory)
 			core.preNVDAExit.register(startNewPortableNVDAInstance)
-	core.triggerNVDAExit()
+	if silent or startAfterCreate:
+		core.triggerNVDAExit()


Test patch:
Repository: nvaccess/nvda

Issue:
Duplicate system tray icons with NVDA 2021.1beta5
### Steps to reproduce:
1. Run NVDA 2021.1beta5.
2. Press NVDA+N to open the NVDA menu and then close it with the Escape key. Without this step, the issue is not reproduced.
3. Restart NVDA with Control+Alt+N.

### Actual behavior:
There are two NVDA icons in the system tray. Each subsequent restart of NVDA with Control+Alt+N adds another icon.

### Expected behavior:
Only one NVDA icon should be displayed in the system tray.

### System configuration
#### NVDA installed/portable/running from source:
installed

#### NVDA version:
2021.1 beta5

#### Windows version:
Windows 10 version 1809

### Other questions
#### Does the issue still occur after restarting your computer?
Yes

#### Have you tried any other versions of NVDA? If so, please report their behaviors.
In NVDA 2020.4, the problem is not reproduced.

#### If add-ons are disabled, is your problem still occurring?
Yes

#### Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?
Yes
[nvda-old.log](https://github.com/nvaccess/nvda/files/6752318/nvda-old.log)



Discussion:
Cc @seanbudd 
I'm sure this is a very well known weirdness. It also seems very hit and 
miss, however clicking the  old icons will remove them, or at least it seems 
to most of the time.


***@***.***
Sent via blueyonder.
Please address personal E-mail to:-
***@***.***, putting 'Brian Gaff'
in the display name field.


This is actually a regression of NVDA 2021.1beta.

Confirmed on my side with NVDA 2021.1beta5 (replacing the ctrl+alt+N step with Enter on the NVDA desktop shortcut).
And confirmed that the issue is not present on installed NVDA 2020.4.

I don't think this is a serious enough issue to prevent the release. We'll aim to fix this in 2021.2

Resolving patch:
diff --git a/source/core.py b/source/core.py
--- a/source/core.py
+++ b/source/core.py
@@ -757,6 +757,7 @@ def _doPostNvdaStartupAction():
 			"NVDA not already exiting, hit catch-all exit trigger."
 			" This likely indicates NVDA is exiting due to WM_QUIT."
 		)
+		queueHandler.pumpAll()
 	_terminate(gui)
 	config.saveOnExit()
 


Test patch:
Repository: nvaccess/nvda

Issue:
NVDA is not passing the Escape key in ARIA grids
This is almost exactly the same issue as https://github.com/nvaccess/nvda/issues/3215, but for grid cells instead of menu items.

Per the authoring practice for grids with widgets in each cell https://www.w3.org/TR/wai-aria-practices/#gridNav_inside, one of the common keyboard convention is to use the escape key to restore grid navigation while the focus in on a widget inside one of the cells. 

However, when user press escape in such situation, NVDA instead switches to browse mode. This causes confusion, especially since there are also no messages announced to the user about this switch or any instructions on how to switch back.


Discussion:

Resolving patch:
diff --git a/source/browseMode.py b/source/browseMode.py
--- a/source/browseMode.py
+++ b/source/browseMode.py
@@ -324,6 +324,7 @@ def event_treeInterceptor_gainFocus(self):
 		controlTypes.Role.MENUITEM,
 		controlTypes.Role.RADIOMENUITEM,
 		controlTypes.Role.CHECKMENUITEM,
+		controlTypes.Role.TABLECELL,
 		})
 
 	def shouldPassThrough(self, obj, reason: Optional[OutputReason] = None):


Test patch: