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

Issue:
Auto-completing e-mail addresses in Microsoft Outlook can cause an error
### Steps to reproduce:
1. Enable braille output in NVDA.
2. In Outlook 2016, start a new e-mail.
3. In the To, Cc or Bcc fields, start typing an e-mail address that is in an auto-complete list, e.g. the address book.

### Expected behavior:
The auto-completed address is announced through a `ui.message`.

### Actual behavior:
```
ERROR - eventHandler.executeEvent (17:40:41.236):
error executing event: stateChange on <appModules.outlook.AutoCompleteListItem object at 0x06E8AE90> with extra args of {}
Traceback (most recent call last):
  File "eventHandler.pyc", line 152, in executeEvent
  File "eventHandler.pyc", line 92, in __init__
  File "eventHandler.pyc", line 107, in next
  File "extensionPoints.pyc", line 135, in callWithSupportedKwargs
  File "appModules\outlook.pyc", line 343, in event_stateChange
  File "ui.pyc", line 67, in message
  File "braille.pyc", line 1676, in message
  File "braille.pyc", line 1296, in update
TypeError: cannot concatenate 'str' and 'NoneType' objects
```

### System configuration:
NVDA version: master-14897,4faf0d05

Windows version: 10.0.16299

Outlook version: 16.0.9029.2106


Discussion:
I'm afraid I can't reproduce this. Is this reproducible when you change the tethering setting to something else?
I can't always reproduce either, but I mostly can by typing quickly and entering a name from the list of suggested contacts Outlook knows I e-mailed before.
Also reproduced in Outlook 2013. I suppose a quick fix is to ignore empty messages in `ui.message`.
I can't seem to reproduce this in Outlook 2016 with NVDA 2018.2.1 anymore, but since the fix is so small it probably won't hurt to add it.

Resolving patch:
diff --git a/source/braille.py b/source/braille.py
--- a/source/braille.py
+++ b/source/braille.py
@@ -1772,10 +1772,10 @@ def message(self, text):
 		"""Display a message to the user which times out after a configured interval.
 		The timeout will be reset if the user scrolls the display.
 		The message will be dismissed immediately if the user presses a cursor routing key.
-		If a key is pressed the message will be dismissed by the next text being written to the display
+		If a key is pressed the message will be dismissed by the next text being written to the display.
 		@postcondition: The message is displayed.
 		"""
-		if not self.enabled or config.conf["braille"]["messageTimeout"] == 0:
+		if not self.enabled or config.conf["braille"]["messageTimeout"] == 0 or text is None:
 			return
 		if self.buffer is self.messageBuffer:
 			self.buffer.clear()


Test patch:
Repository: nvaccess/nvda

Issue:
Document formatting preferences don't always apply to braille in browse mode
### Steps to reproduce:
1. Select a braille table that can report italic text.
2. From Preferences --> Document formatting, uncheck Font attributes.
3. Read the following line (tested with Firefox 55).

This is _italic_ text.

### Expected behavior:
The italic text is not marked as italic.

### Actual behavior:
Speech does indeed not mention the italic attribute, but braille still shows it.

### Other information
Can't reproduce in Word, so it seems specific to browse mode.

First reported by @rimas-kudelis in https://github.com/nvaccess/nvda/issues/1885#issuecomment-328823096. The key take-away point is that this problem is quite annoying for users on the web, and if unresolved may lead to people "fixing" braille tables to exclude bold/italic/etc altogether.


Discussion:
@dkager For completeness and to be able to reproduce, which table would support such attributes?
The Dutch tables, and probably UEB.
This can be fixed with a simple patch of braille.py to consider formatConfig before sending text formatting flags to liblouis.

A further optimization is to not fetch IA2 [text attributes](https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes) and [object attributes](https://wiki.linuxfoundation.org/accessibility/iaccessible2/objectattributes) if all the formatConfig options that rely on them are disabled. This saves a few COM calls but the gains are probably minimal.

Resolving patch:
diff --git a/source/braille.py b/source/braille.py
--- a/source/braille.py
+++ b/source/braille.py
@@ -803,8 +803,10 @@ def _setCursor(self, info):
 		except NotImplementedError:
 			log.debugWarning("", exc_info=True)
 
-	def _getTypeformFromFormatField(self, field):
+	def _getTypeformFromFormatField(self, field, formatConfig):
 		typeform = louis.plain_text
+		if not formatConfig["reportFontAttributes"]:
+			return typeform
 		if field.get("bold", False):
 			typeform |= louis.bold
 		if field.get("italic", False):
@@ -860,7 +862,7 @@ def _addTextWithFields(self, info, formatConfig, isSelection=False):
 				cmd = command.command
 				field = command.field
 				if cmd == "formatChange":
-					typeform = self._getTypeformFromFormatField(field)
+					typeform = self._getTypeformFromFormatField(field, formatConfig)
 					text = getFormatFieldBraille(field, formatFieldAttributesCache, self._isFormatFieldAtStart, formatConfig)
 					if not text:
 						continue


Test patch:
Repository: nvaccess/nvda

Issue:
The NVDA Usage Statistics Dialog shouldn't appear in try builds on startup
### Steps to reproduce:
Start NVDA (portable) the very first time. (No config folder exists.)
### Actual behaviour:
After the Welcome Dialog the NVDA Usage Statistics Dialog appears also in try builds.
### Expected behaviour:
After the Welcome Dialog the NVDA Usage Statistics Dialog doesn't appear in try builds.
#### Reasons:
Based on the [comment by @jcsteh in PR #8678](https://github.com/nvaccess/nvda/pull/8678#issuecomment-416833221) the whole update check procedure is disabled in try builds. So showing this dialog on startup makes no sense. Furthermore the checkbox "Allow the NVDA project to gather NVDA usage statistics" in the General NVDA Settings doesn't exists, so it's only possible to change this value by editing "nvda.ini" with Notepad++ directly.
#### Entries in "nvda.ini":
`[update]`
`	allowUsageStats = False`
`	askedAllowUsageStats = True`
### System configuration:
#### NVDA installed/portable/running from source:
Portable
#### NVDA version:
try-15940 (provided via PR #8678)
#### Windows version:
win7x64
### Other questions:
#### Have you tried any other versions of NVDA?
No. I don't think that this behaviour should be changed in alpha builds and higher.


Discussion:
This makes sense and is very easy to fix, though I don't think it has much priority.

Resolving patch:
diff --git a/source/core.py b/source/core.py
--- a/source/core.py
+++ b/source/core.py
@@ -79,8 +79,21 @@ def doStartupDialogs():
 		gui.messageBox(_("Your gesture map file contains errors.\n"
 				"More details about the errors can be found in the log file."),
 			_("gesture map File Error"), wx.OK|wx.ICON_EXCLAMATION)
-	if not globalVars.appArgs.secure and not config.isAppX and not config.conf['update']['askedAllowUsageStats']:
-		gui.runScriptModalDialog(gui.AskAllowUsageStatsDialog(None))
+	try:
+		import updateCheck
+	except RuntimeError:
+		updateCheck=None
+	if updateCheck and not config.conf['update']['askedAllowUsageStats']:
+		# a callback to save config after the usage stats question dialog has been answered.
+		def onResult(ID):
+			import wx
+			if ID in (wx.ID_YES,wx.ID_NO):
+				try:
+					config.conf.save()
+				except:
+					pass
+		# Ask the user if usage stats can be collected.
+		gui.runScriptModalDialog(gui.AskAllowUsageStatsDialog(None),onResult)
 
 def restart(disableAddons=False, debugLogging=False):
 	"""Restarts NVDA by starting a new copy with -r."""


Test patch:
Repository: nvaccess/nvda

Issue:
Update to Liblouis 3.7
Liblouis 3.7 is due for release next week. Here is what's new/relevant for us:

- Fix input/output positions for back-translation
- New Chinese Mandarin Braille Codes (Grade 1) and (Grade 2)
- Improvements to UEB

This list is not complete yet.


Discussion:
Hi to all,

For the braille tables, i will do the PR for the braille tables.



Windows builds are currently broken. See https://github.com/liblouis/liblouis/issues/634.

In the liblouis repository, there is already a 3.7.0 tag, so it looks like this is not going to be fixed before the release. In that case, we'll have to skip 3.7.0, since I'm not particularly interested in the inclusion of a fork in NVDA.
https://github.com/liblouis/liblouis/issues/634 is now solved.

Resolving patch:
diff --git a/source/brailleTables.py b/source/brailleTables.py
--- a/source/brailleTables.py
+++ b/source/brailleTables.py
@@ -380,6 +380,12 @@ def listTables():
 addTable("vi-g1.ctb", _("Vietnamese grade 1"))
 # Translators: The name of a braille table displayed in the
 # braille settings dialog.
+addTable("zhcn-g1.ctb", _("Chinese (China, Mandarin) grade 1"))
+# Translators: The name of a braille table displayed in the
+# braille settings dialog.
+addTable("zhcn-g2.ctb", _("Chinese (China, Mandarin) grade 2"))
+# Translators: The name of a braille table displayed in the
+# braille settings dialog.
 addTable("zh-hk.ctb", _("Chinese (Hong Kong, Cantonese)"))
 # Translators: The name of a braille table displayed in the
 # braille settings dialog.


Test patch:
Repository: nvaccess/nvda

Issue:
NVDA doesn't read anything on iTunes
Today I woke up and NVDA was no longer reading anything on iTunes.  After investigating I figured that iTunes was updated to version 12.9.0.167 from the Microsoft Store overnight, so suspecting it might be an issue with iTunes I tried Narrator which worked just fine.

I'm running Microsoft Windows 10 Home version 10.0.17134 Build 17134 with NVDA 2018.2.1, and after analyzing the [log](https://github.com/nvaccess/nvda/files/2379550/nvda.log) I found that there were exceptions every time I tried to interact with iTunes.


Discussion:
It looks like ITunes switched to UIA, at least for parts of it.

A quick workaround might be force disabling UIA for now on the app module level, or update the appModule to be compatible with those.

Marking this as a p2, since ITunes is a widely used product and these issues seem pretty serious. Furthermore, they are caused by the NVDA appModule

Resolving patch:
diff --git a/source/appModules/itunes.py b/source/appModules/itunes.py
--- a/source/appModules/itunes.py
+++ b/source/appModules/itunes.py
@@ -2,7 +2,7 @@
 #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) 2009-2015 NV Access Limited
+#Copyright (C) 2009-2018 NV Access Limited, Leonard de Ruijter
 
 """App module for iTunes
 """
@@ -17,6 +17,7 @@
 import api
 import eventHandler
 import NVDAObjects.IAccessible
+import NVDAObjects.UIA
 from NVDAObjects.IAccessible import webKit
 
 class AppModule(appModuleHandler.AppModule):
@@ -39,6 +40,10 @@ def event_NVDAObject_init(self,obj):
 				obj.presentationType = obj.presType_layout
 
 	def chooseNVDAObjectOverlayClasses(self, obj, clsList):
+		if isinstance(obj,NVDAObjects.UIA.UIA):
+			# iTunes 12.9 implements UIA for many controls.
+			# Just leave them untouched for now.
+			return
 		windowClassName=obj.windowClassName
 		role=obj.role
 		if windowClassName in ('iTunesList','iTunesSources','iTunesTrackList') and role in (controlTypes.ROLE_LISTITEM,controlTypes.ROLE_TREEVIEWITEM):


Test patch:
Repository: nvaccess/nvda

Issue:
UnicodeDecodeError when NVDA running on non-English outdated systems
When runing the latest NVDA snapshots on Russian versions of outdated Windows (XP/Vista), in the log I have the following exception:
Traceback (most recent call last):
File "nvda.pyw", line 64, in <module>
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 0: ordinal not in range(128)

Probably, need to explicitly specify the system encoding, since in Russian Windows it is cp1251.
For example, like so:
import winVersion
import locale
if not winVersion.isSupportedOS():
	winUser.MessageBox(0, unicode(ctypes.FormatError(winUser.ERROR_OLD_WIN_VERSION), locale.getpreferredencoding()), None, winUser.MB_ICONERROR)
	sys.exit(1)
Now the dialogue will be shown correctly.



Discussion:
CC @MichaelDCurran

 

From: kvark128 [mailto:notifications@github.com] 
Sent: Monday, September 11, 2017 8:09 AM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: [nvaccess/nvda] UnicodeDecodeError when NVDA running on non-English outdated systems (#7586)

 

When runing the latest NVDA snapshots on Russian versions of outdated Windows (XP/Vista), in the log I have the following exception:
Traceback (most recent call last):
File "nvda.pyw", line 64, in 
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 0: ordinal not in range(128)

Probably, need to explicitly specify the system encoding, since in Russian Windows it is cp1251.
For example, like so:
import winVersion
import locale
if not winVersion.isSupportedOS():
winUser.MessageBox(0, unicode(ctypes.FormatError(winUser.ERROR_OLD_WIN_VERSION), locale.getpreferredencoding()), None, winUser.MB_ICONERROR)
sys.exit(1)
Now the dialogue will be shown correctly.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <https://github.com/nvaccess/nvda/issues/7586> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AHgLkP5IP0Nvq-Py-w48HdzQZv2FBNm-ks5shU0BgaJpZM4PTUAx> .


This issue seems to occur on Windows XP or Vista with snapshots of NVDA. NVDA 2017.3 was released before September 2017 I guess. So support after that has been dropped. I vote for closing this issue.
Hi,

If this issue does not occur on Windows 7 SP1 or newer, then yes, it should be closed.

Thanks.

Resolving patch:
diff --git a/source/winUser.py b/source/winUser.py
--- a/source/winUser.py
+++ b/source/winUser.py
@@ -514,6 +514,10 @@ def FindWindow(className, windowName):
 IDCANCEL=3
 
 def MessageBox(hwnd, text, caption, type):
+	if isinstance(text, bytes):
+		text = text.decode('mbcs')
+	if isinstance(caption, bytes):
+		caption = caption.decode('mbcs')
 	res = user32.MessageBoxW(hwnd, text, caption, type)
 	if res == 0:
 		raise WinError()


Test patch:
Repository: nvaccess/nvda

Issue:
Config profile triggers: a nonexistent key causes key error traceback when attempting to switch between profiles
Hi,

Perhaps a regression from Emoji announcement work: one cannot switch to profiles without encountering key error exception traceback.

### Steps to reproduce:
1. Create one or more config profiles.
2. Open config profiles (Control+NVDA+P) and try to switch to a profile manually.
3. Alternatively, trigger a profile via say all, switching between apps and so on.

### Actual behavior:
ERROR - unhandled exception (21:28:27.158):
Traceback (most recent call last):
  File "gui\configProfiles.pyc", line 259, in onClose
  File "config\__init__.pyc", line 753, in disableProfileTriggers
  File "config\__init__.pyc", line 374, in _handleProfileSwitch
  File "config\__init__.pyc", line 943, in dict
  File "config\__init__.pyc", line 941, in dict
  File "config\__init__.pyc", line 864, in __getitem__
KeyError: u'x'

### Expected behavior:
Profile switching works normally.

### System configuration:

#### NVDA Installed/portable/running from source:
Installed

#### NVDA version:
Alpha.16103

#### Windows version:
Windows 10 Version 1809 Preview

#### 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 PC?
Yes

#### Have you tried any other versions of NVDA?
No

Thanks.


Discussion:
P1, CC @LeonardDer

Resolving patch:
diff --git a/source/config/__init__.py b/source/config/__init__.py
--- a/source/config/__init__.py
+++ b/source/config/__init__.py
@@ -937,17 +937,16 @@ def dict(self):
 		Adapted from L{configobj.Section.dict}.
 		"""
 		newdict = {}
-		for entry in self:
-			this_entry = self[entry]
-			if isinstance(this_entry, AggregatedSection):
-				this_entry = this_entry.dict()
-			elif isinstance(this_entry, list):
+		for key, value in self.iteritems():
+			if isinstance(value, AggregatedSection):
+				value = value.dict()
+			elif isinstance(value, list):
 				# create a copy rather than a reference
-				this_entry = list(this_entry)
-			elif isinstance(this_entry, tuple):
+				value = list(value)
+			elif isinstance(value, tuple):
 				# create a copy rather than a reference
-				this_entry = tuple(this_entry)
-			newdict[entry] = this_entry
+				value = tuple(value)
+			newdict[key] = value
 		return newdict
 
 	def __setitem__(self, key, val):


Test patch:
Repository: nvaccess/nvda

Issue:
UIA seems to stall under certain conditions.
### Steps to reproduce:
1. start a process like a batch processing job in total recorder or goldwave.
2. open any listview, explorer, etc. 
### Expected behavior:
the listview should read

### Actual behavior:
the listview doesn't read.> Tell us what happens instead.

### System configuration:
NVDA version: 2017.2


NVDA Installed or portable: installed.
Other information:


Windows version: windows 10 pro creator update. 
### Other questions:

Does the issue still occur after restarting your PC? yes

Have you tried any other versions of NVDA? reproduceable from 2016 onward





Discussion:

Resolving patch:
diff --git a/source/_UIAHandler.py b/source/_UIAHandler.py
--- a/source/_UIAHandler.py
+++ b/source/_UIAHandler.py
@@ -183,6 +183,25 @@ def MTAThreadFunc(self):
 				isUIA8=True
 			except (COMError,WindowsError,NameError):
 				self.clientObject=CoCreateInstance(CUIAutomation._reg_clsid_,interface=IUIAutomation,clsctx=CLSCTX_INPROC_SERVER)
+			# #7345: Instruct UIA to never map MSAA winEvents to UIA propertyChange events.
+			# These events are not needed by NVDA, and they can cause the UI Automation client library to become unresponsive if an application firing winEvents has a slow message pump. 
+			pfm=self.clientObject.proxyFactoryMapping
+			for index in xrange(pfm.count):
+				e=pfm.getEntry(index)
+				for propertyID in UIAPropertyIdsToNVDAEventNames.keys():
+					# Check if this proxy has mapped any winEvents to the UIA propertyChange event for this property ID 
+					try:
+						oldWinEvents=e.getWinEventsForAutomationEvent(UIA_AutomationPropertyChangedEventId,propertyID)
+					except IndexError:
+						# comtypes does not seem to correctly handle a returned empty SAFEARRAY, raising IndexError
+						oldWinEvents=None
+					if oldWinEvents:
+						# As winEvents were mapped, replace them with an empty list
+						e.setWinEventsForAutomationEvent(UIA_AutomationPropertyChangedEventId,propertyID,[])
+						# Changes to an enty are not automatically picked up.
+						# Therefore remove the entry and re-insert it.
+						pfm.removeEntry(index)
+						pfm.insertEntry(index,e)
 			if isUIA8:
 				# #8009: use appropriate interface based on highest supported interface.
 				# #8338: made easier by traversing interfaces supported on Windows 8 and later in reverse.


Test patch:
Repository: nvaccess/nvda

Issue:
NVDA is not passing the Escape key in ARIA menus
**Reported by dfarough on 2013-05-10 15:32**
Can NVDA pass the handling of escape key presses to the widgit for ARIA menus?  See http://www.w3.org/TR/wai-aria-practices/#menu
for info



Discussion:
This is quite annoying when working with ARIA menus, autocompletes, etc.

[Test case (rename to .html)](https://github.com/nvaccess/nvda/files/1110668/fakeAutocomplete.html.txt)

STR:

1. Open the test case.
2. In browse mode, move the cursor to the edit field and press enter. Observe that NVDA switches to focus mode.
3. Press down arrow. Observe that NVDA reports "Some item".
4. Press escape.
    * Expected: NVDA should remain in focus mode and report the edit field, since it got focus.
    * Actual: NVDA switches to browse mode. The menu item remains focused.

P2 because this can be very confusing when trying to work with ARIA autocompletes and menus. Some users may not understand what's happening and thus not be able to figure out how to work around it.

Resolving patch:
diff --git a/source/browseMode.py b/source/browseMode.py
--- a/source/browseMode.py
+++ b/source/browseMode.py
@@ -279,6 +279,12 @@ def _get_currentNVDAObject(self):
 		controlTypes.ROLE_CHECKMENUITEM,
 		})
 
+	IGNORE_DISABLE_PASS_THROUGH_WHEN_FOCUSED_ROLES = frozenset({
+		controlTypes.ROLE_MENUITEM,
+		controlTypes.ROLE_RADIOMENUITEM,
+		controlTypes.ROLE_CHECKMENUITEM,
+		})
+
 	def shouldPassThrough(self, obj, reason=None):
 		"""Determine whether pass through mode should be enabled (focus mode) or disabled (browse mode) for a given object.
 		@param obj: The object in question.
@@ -473,6 +479,10 @@ def script_activatePosition(self,gesture):
 	def script_disablePassThrough(self, gesture):
 		if not self.passThrough or self.disableAutoPassThrough:
 			return gesture.send()
+		# #3215 ARIA menus should get the Escape key unconditionally so they can handle it without invoking browse mode first
+		obj = api.getFocusObject()
+		if obj and obj.role in self.IGNORE_DISABLE_PASS_THROUGH_WHEN_FOCUSED_ROLES:
+			return gesture.send()
 		self.passThrough = False
 		self.disableAutoPassThrough = False
 		reportPassThrough(self)


Test patch:
Repository: nvaccess/nvda

Issue:
Change shortcut in MS Word Elements List for Errors to Alt+S
1. Open Microsoft Word.
2. Toggle browse mode.
3. Open the Elements List.
4. Press Alt+E to get the spelling errors.
5. You will be placed in the Filter by field.
6. Press it again, you're stuck.

I propose that Alt+S or Alt+R be used instead to move quickly to the errors. Alt+S would be ideal, since these are spelling errors. However, Alt+R is also available, so it can be used.


Discussion:
Alt+s isn't going to work, since the word errors contains no s. r should work though. However, I'm not particularly happy with all these accelerators messing up, like e for filter by which doesn't make very much sense, and now also errors having to change due to conflicts. I'd rather come up with a sensible default for filter by which is unlikely to conflict any time soon, so errors can stay the same.

See also https://github.com/nvaccess/nvda/issues/7569

Resolving patch:
diff --git a/source/browseMode.py b/source/browseMode.py
--- a/source/browseMode.py
+++ b/source/browseMode.py
@@ -815,7 +815,7 @@ def __init__(self, document):
 
 		# Translators: The label of an editable text field to filter the elements
 		# in the browse mode Elements List dialog.
-		filterText = _("Filt&er by:")
+		filterText = _("Filter b&y:")
 		labeledCtrl = gui.guiHelper.LabeledControlHelper(self, filterText, wx.TextCtrl)
 		self.filterEdit = labeledCtrl.control
 		self.filterEdit.Bind(wx.EVT_TEXT, self.onFilterEditTextChange)


Test patch: