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

Issue:
Unicode Encode error in Microsoft Excel
In Microsoft Excel when pressing NVDA+numpadDelete 
for report sheet name, exception UnicodeEncodeError arises Here.
```
ERROR - scriptHandler.executeScript (20:14:49):
error executing script: <bound method 
GlobalCommands.script_navigatorObject_currentDimensions of 
<globalCommands.GlobalCommands object at 0x05CB4090>> with gesture 
u'NVDA+delete \u043d\u0430 
\u0446\u0438\u0444\u0440\u043e\u0432\u043e\u043c 
\u0431\u043b\u043e\u043a\u0435'
Traceback (most recent call last):
   File "scriptHandler.py", line 187, in executeScript
     script(gesture)
   File "globalCommands.py", line 804, in 
script_navigatorObject_currentDimensions
     locationText=api.getReviewPosition().locationText if count==0 else None
   File "baseObject.py", line 21, in __get__
     return self.fget(instance)
   File "NVDAObjects\window\excel.py", line 991, in _get_locationText
     return self.obj.getCellPosition()
   File "NVDAObjects\window\excel.py", line 1136, in getCellPosition
     return "Sheet {0}, {1}".format(sheet, rowAndColumn)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 
0-3: ordinal not in range(128)
```

This string should be unicode, and translatable.


Discussion:
Introduced in #6736

Resolving patch:
diff --git a/source/NVDAObjects/window/excel.py b/source/NVDAObjects/window/excel.py
--- a/source/NVDAObjects/window/excel.py
+++ b/source/NVDAObjects/window/excel.py
@@ -1133,7 +1133,7 @@ def _get_columnNumber(self):
 	def getCellPosition(self):
 		rowAndColumn = self.cellCoordsText
 		sheet = self.excelWindowObject.ActiveSheet.name
-		return "Sheet {0}, {1}".format(sheet, rowAndColumn)
+		return u"Sheet {0}, {1}".format(sheet, rowAndColumn)
 
 	def _get_tableID(self):
 		address=self.excelCellObject.address(1,1,0,1)


Test patch:
Repository: nvaccess/nvda

Issue:
Unicode Encode error in Microsoft Excel
In Microsoft Excel when pressing NVDA+numpadDelete 
for report sheet name, exception UnicodeEncodeError arises Here.
```
ERROR - scriptHandler.executeScript (20:14:49):
error executing script: <bound method 
GlobalCommands.script_navigatorObject_currentDimensions of 
<globalCommands.GlobalCommands object at 0x05CB4090>> with gesture 
u'NVDA+delete \u043d\u0430 
\u0446\u0438\u0444\u0440\u043e\u0432\u043e\u043c 
\u0431\u043b\u043e\u043a\u0435'
Traceback (most recent call last):
   File "scriptHandler.py", line 187, in executeScript
     script(gesture)
   File "globalCommands.py", line 804, in 
script_navigatorObject_currentDimensions
     locationText=api.getReviewPosition().locationText if count==0 else None
   File "baseObject.py", line 21, in __get__
     return self.fget(instance)
   File "NVDAObjects\window\excel.py", line 991, in _get_locationText
     return self.obj.getCellPosition()
   File "NVDAObjects\window\excel.py", line 1136, in getCellPosition
     return "Sheet {0}, {1}".format(sheet, rowAndColumn)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 
0-3: ordinal not in range(128)
```

This string should be unicode, and translatable.


Discussion:
Introduced in #6736

Resolving patch:
diff --git a/source/NVDAObjects/window/excel.py b/source/NVDAObjects/window/excel.py
--- a/source/NVDAObjects/window/excel.py
+++ b/source/NVDAObjects/window/excel.py
@@ -1133,7 +1133,8 @@ def _get_columnNumber(self):
 	def getCellPosition(self):
 		rowAndColumn = self.cellCoordsText
 		sheet = self.excelWindowObject.ActiveSheet.name
-		return u"Sheet {0}, {1}".format(sheet, rowAndColumn)
+		# Translators: a message reported in the get location text script for Excel. {0} is replaced with the name of the excel worksheet, and {1} is replaced with the row and column identifier EG "G4"
+		return _(u"Sheet {0}, {1}").format(sheet, rowAndColumn)
 
 	def _get_tableID(self):
 		address=self.excelCellObject.address(1,1,0,1)


Test patch:
Repository: nvaccess/nvda

Issue:
Keyboard hook swallows all keys if script without docstring blocks (e.g. gui.messageBox)
STR:
1. Install [testplugin](https://github.com/nvaccess/nvda/files/728853/testplugin.txt) into globalPlugins.
2. Press NVDA+0. When the dialog is up, press windows+m, then a letter that doesn't exist.

Normally I would hear a beep, however I don't hear anything; NVDA disables my keyboard.
If it doesn't work, try a few more times; this doesn't trigger 100% of the time.

My media keys still work (previous, play/pause, next and volume). If I turn Handle keys from other applications on, they stop working like the rest of the keys.


Discussion:
Discussed/debugged this on IRC.

Impact: If a script without a docstring blocks, NVDA traps all possible keys, making it impossible to even kill or restart NVDA from the keyboard. While this shouldn't occur in normal use, it's still pretty severe, particularly for developers.

This occurs because in order to fix #2953, we queue all keys to be sent later by our main thread if a script without a docstring (an intercepted application command) is queued/running. This ensures that keys such as backspace (which NVDA intercepts) don't end up out of sequence with typed characters (keys we don't intercept) if NVDA's main thread takes a while to process something.

The main thread isn't supposed to be blocked, but it's entirely possible to do this by mistake. We certainly shouldn't swallow keystrokes forever if this occurs.

inputCore does check watchdog to see if the core is alive and it passes gestures straight through if not. This should mean we recover from this within 10 seconds, but it seems we don't.

What I don't currently understand is why the watchdog isn't triggering in this case. P2 to at least investigate this.
CC @MichaelDCurran.

Resolving patch:
diff --git a/source/core.py b/source/core.py
--- a/source/core.py
+++ b/source/core.py
@@ -466,9 +466,8 @@ def requestPump():
 
 def callLater(delay, callable, *args, **kwargs):
 	"""Call a callable once after the specified number of milliseconds.
-	This is currently a thin wrapper around C{wx.CallLater},
-	but this should be used instead for calls which aren't just for UI,
-	as it notifies watchdog appropriately.
+	As the call is executed within NVDA's core queue, it is possible that execution will take place slightly after the requested time.
+	This function should never be used to execute code that brings up a modal UI as it will cause NVDA's core to block.
 	This function can be safely called from any thread.
 	"""
 	import wx
@@ -478,9 +477,5 @@ def callLater(delay, callable, *args, **kwargs):
 		return wx.CallAfter(wx.CallLater,delay, _callLaterExec, callable, args, kwargs)
 
 def _callLaterExec(callable, args, kwargs):
-	import watchdog
-	watchdog.alive()
-	try:
-		return callable(*args, **kwargs)
-	finally:
-		watchdog.asleep()
+	import queueHandler
+	queueHandler.queueFunction(queueHandler.eventQueue,callable,*args, **kwargs)


Test patch:
Repository: nvaccess/nvda

Issue:
Support spelling with character descriptions in reportCurrentLine
When reading the current line, pressing review_currentLine three times spells the line using character descriptions.
However, reportCurrentLine doesn't support this.

I think it should, for consistency.


Discussion:

Resolving patch:
diff --git a/source/globalCommands.py b/source/globalCommands.py
--- a/source/globalCommands.py
+++ b/source/globalCommands.py
@@ -138,12 +138,13 @@ def script_reportCurrentLine(self,gesture):
 		except (NotImplementedError, RuntimeError):
 			info=obj.makeTextInfo(textInfos.POSITION_FIRST)
 		info.expand(textInfos.UNIT_LINE)
-		if scriptHandler.getLastScriptRepeatCount()==0:
+		scriptCount=scriptHandler.getLastScriptRepeatCount()
+		if scriptCount==0:
 			speech.speakTextInfo(info,unit=textInfos.UNIT_LINE,reason=controlTypes.REASON_CARET)
 		else:
-			speech.speakSpelling(info.text)
+			speech.spellTextInfo(info,useCharacterDescriptions=scriptCount>1)
 	# Translators: Input help mode message for report current line command.
-	script_reportCurrentLine.__doc__=_("Reports the current line under the application cursor. Pressing this key twice will spell the current line")
+	script_reportCurrentLine.__doc__=_("Reports the current line under the application cursor. Pressing this key twice will spell the current line. Pressing three times will spell the line using character descriptions.")
 	script_reportCurrentLine.category=SCRCAT_SYSTEMCARET
 
 	def script_leftMouseClick(self,gesture):


Test patch:
Repository: nvaccess/nvda

Issue:
Edge: role="document" breaks browse mode
STR:

1. Open [this test case](https://github.com/nvaccess/nvda/files/860236/roleDocument.html.txt) in Edge. (Rename to .html.)
2. Try to switch between focus and browse modes with NVDA+space.
    * Expected: NVDA should indicate that it is switching.
    * Actual: Nothing happens.

role="document" breaks detection of the EdgeHTMLRootContainer, I guess because it changes the UIA control type.

Practical impact: Can't read the [ARIA 1.1 spec](https://www.w3.org/TR/wai-aria-1.1/) in Edge.

CC @MichaelDCurran.


Discussion:
Hi, got a COM error in 14393, cannot switch to focus mode in 15063. Thanks.

 

From: James Teh [mailto:notifications@github.com] 
Sent: Tuesday, March 21, 2017 8:04 PM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: [nvaccess/nvda] Edge: role="document" breaks browse mode (#6998)

 

STR:

1.	Open this test case <https://github.com/nvaccess/nvda/files/860236/roleDocument.html.txt>  in Edge. (Rename to .html.)
2.	Try to switch between focus and browse modes with NVDA+space. 

*	Expected: NVDA should indicate that it is switching.
*	Actual: Nothing happens.

role="document" breaks detection of the EdgeHTMLRootContainer, I guess because it changes the UIA control type.

Practical impact: Can't read the ARIA 1.1 spec <https://www.w3.org/TR/wai-aria-1.1/>  in Edge.

CC @MichaelDCurran <https://github.com/MichaelDCurran> .

—
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/6998> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AHgLkOXJkywUyt6gun8FtSekesVkycbFks5roI-VgaJpZM4Mkq0R> .



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
@@ -580,7 +580,11 @@ def findOverlayClasses(self,clsList):
 			import edge
 			if UIAClassName in ("Internet Explorer_Server","WebView") and self.role==controlTypes.ROLE_PANE:
 				clsList.append(edge.EdgeHTMLRootContainer)
-			elif self.UIATextPattern and self.role==controlTypes.ROLE_PANE and self.parent and (isinstance(self.parent,edge.EdgeHTMLRootContainer) or not isinstance(self.parent,edge.EdgeNode)): 
+			elif (self.UIATextPattern and
+				# #6998: Edge normally gives its root node a controlType of pane, but ARIA role="document"  changes the controlType to document
+				self.role in (controlTypes.ROLE_PANE,controlTypes.ROLE_DOCUMENT) and 
+				self.parent and (isinstance(self.parent,edge.EdgeHTMLRootContainer) or not isinstance(self.parent,edge.EdgeNode))
+			): 
 				clsList.append(edge.EdgeHTMLRoot)
 			elif self.role==controlTypes.ROLE_LIST:
 				clsList.append(edge.EdgeList)


Test patch:
Repository: nvaccess/nvda

Issue:
Pressing t incorrectly omits the table on this site in edge.
1. Go to https://dequeuniversity.com/library/aria/tables/sf-sortable-grid
2. Try pressing t in edge. moving to the table fails.


Discussion:

Resolving patch:
diff --git a/source/UIABrowseMode.py b/source/UIABrowseMode.py
--- a/source/UIABrowseMode.py
+++ b/source/UIABrowseMode.py
@@ -273,7 +273,7 @@ def _iterNodesByType(self,nodeType,direction="next",pos=None):
 			condition=UIAHandler.handler.clientObject.createPropertyCondition(UIAHandler.UIA_ControlTypePropertyId,UIAHandler.UIA_ImageControlTypeId)
 			return UIAControlQuicknavIterator(nodeType,self,pos,condition,direction)
 		elif nodeType=="table":
-			condition=UIAHandler.handler.clientObject.createPropertyCondition(UIAHandler.UIA_ControlTypePropertyId,UIAHandler.UIA_TableControlTypeId)
+			condition=createUIAMultiPropertyCondition({UIAHandler.UIA_ControlTypePropertyId:[UIAHandler.UIA_TableControlTypeId,UIAHandler.UIA_DataGridControlTypeId]})
 			return UIAControlQuicknavIterator(nodeType,self,pos,condition,direction)
 		elif nodeType=="separator":
 			condition=UIAHandler.handler.clientObject.createPropertyCondition(UIAHandler.UIA_ControlTypePropertyId,UIAHandler.UIA_SeparatorControlTypeId)
@@ -285,7 +285,7 @@ def _iterNodesByType(self,nodeType,direction="next",pos=None):
 			condition=createUIAMultiPropertyCondition({UIAHandler.UIA_ControlTypePropertyId:UIAHandler.UIA_ListControlTypeId,UIAHandler.UIA_IsKeyboardFocusablePropertyId:False})
 			return UIAControlQuicknavIterator(nodeType,self,pos,condition,direction)
 		elif nodeType=="container":
-			condition=createUIAMultiPropertyCondition({UIAHandler.UIA_ControlTypePropertyId:UIAHandler.UIA_ListControlTypeId,UIAHandler.UIA_IsKeyboardFocusablePropertyId:False},{UIAHandler.UIA_ControlTypePropertyId:UIAHandler.UIA_TableControlTypeId})
+			condition=createUIAMultiPropertyCondition({UIAHandler.UIA_ControlTypePropertyId:UIAHandler.UIA_ListControlTypeId,UIAHandler.UIA_IsKeyboardFocusablePropertyId:False},{UIAHandler.UIA_ControlTypePropertyId:[UIAHandler.UIA_TableControlTypeId,UIAHandler.UIA_DataGridControlTypeId]})
 			return UIAControlQuicknavIterator(nodeType,self,pos,condition,direction)
 		elif nodeType=="edit":
 			condition=createUIAMultiPropertyCondition({UIAHandler.UIA_ControlTypePropertyId:UIAHandler.UIA_EditControlTypeId,UIAHandler.UIA_ValueIsReadOnlyPropertyId:False},{UIAHandler.UIA_ControlTypePropertyId:UIAHandler.UIA_ComboBoxControlTypeId,UIAHandler.UIA_IsTextPatternAvailablePropertyId:True})


Test patch:
Repository: nvaccess/nvda

Issue:
Split panes are regarded to as content
As @feerrenrut requested, here is some more technical background for #7049.

IBM SPSS Statistics is software for statistical analysis, written in JAVA. In its data view, it is very verbose on every press of an arrow key, reporting the following before the actual data: "Split pane, table, table, split pane, table, table" 

As this is quite obnoxious, I went investigating how to make this application less verbose. In that process, I noticed that split panes do have presentation type content instead of layout. I reported this on [the development list](http://nabble.nvda-project.org/Split-panes-have-presentation-type-content-tt41789.html), as I wasn't sure yet whether this is intentional. It doesn't seem so according to @jcsteh, so that's why I created #7049.

Please note that this improves verbosity in SPSS' data view, but NVDA will still announce table four times before it will tell the contents of the actual cell selected. So, this is not a complete fix for the SPSS verbosity complaint.


Discussion:

Resolving patch:
diff --git a/source/NVDAObjects/__init__.py b/source/NVDAObjects/__init__.py
--- a/source/NVDAObjects/__init__.py
+++ b/source/NVDAObjects/__init__.py
@@ -1,7 +1,7 @@
 # -*- coding: UTF-8 -*-
 #NVDAObjects/__init__.py
 #A part of NonVisual Desktop Access (NVDA)
-#Copyright (C) 2006-2016 NV Access Limited, Peter Vágner, Aleksey Sadovoy, Patrick Zajda
+#Copyright (C) 2006-2017 NV Access Limited, Peter Vágner, Aleksey Sadovoy, Patrick Zajda, Babbage B.V.
 #This file is covered by the GNU General Public License.
 #See the file COPYING for more details.
 
@@ -611,7 +611,7 @@ def _get_presentationType(self):
 			text=self.makeTextInfo(textInfos.POSITION_ALL).text
 			return self.presType_content if text and not text.isspace() else self.presType_layout
 
-		if role in (controlTypes.ROLE_UNKNOWN, controlTypes.ROLE_PANE, controlTypes.ROLE_TEXTFRAME, controlTypes.ROLE_ROOTPANE, controlTypes.ROLE_LAYEREDPANE, controlTypes.ROLE_SCROLLPANE, controlTypes.ROLE_SECTION, controlTypes.ROLE_PARAGRAPH, controlTypes.ROLE_TITLEBAR, controlTypes.ROLE_LABEL, controlTypes.ROLE_WHITESPACE,controlTypes.ROLE_BORDER):
+		if role in (controlTypes.ROLE_UNKNOWN, controlTypes.ROLE_PANE, controlTypes.ROLE_TEXTFRAME, controlTypes.ROLE_ROOTPANE, controlTypes.ROLE_LAYEREDPANE, controlTypes.ROLE_SCROLLPANE, controlTypes.ROLE_SPLITPANE, controlTypes.ROLE_SECTION, controlTypes.ROLE_PARAGRAPH, controlTypes.ROLE_TITLEBAR, controlTypes.ROLE_LABEL, controlTypes.ROLE_WHITESPACE,controlTypes.ROLE_BORDER):
 			return self.presType_layout
 		name = self.name
 		description = self.description


Test patch:
Repository: nvaccess/nvda

Issue:
When the -c option is used when starting NVDA user configuration can not be saved
Steps to reproduce:

- Open a command prompt and cd to the nvda.exe directory.
- start nvda with `nvda.exe -c "C:\myTemp"
- open the nvda menu and select "save configuration"

An error is shown "Could not save configuration - probably read only file system".

Regression caused by atomic rename/write fix. Config path is unicode without `-c`, but when `-c` is passed, the config path is ANSI. fileUtils assumes path is always Unicode.


Discussion:
I guess this can be fixed by changing -c from str to unicode in the argument parser. That should be done anyway. This wasn't possible in the days of optparse I belief.

Oh. Does argparse know how to retrieve command line options in Unicode? I
thought that was a limitation of Python 2 (because sys.argv is ANSI).

Hmmmm, that's something I should test. But probably not, then.

N.B. Sent on behalf of @BabbageCom

> Op 28 apr. 2017 om 08:30 heeft James Teh <notifications@github.com> het volgende geschreven:
> 
> Oh. Does argparse know how to retrieve command line options in Unicode? I
> thought that was a limitation of Python 2 (because sys.argv is ANSI).
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub, or mute the thread.
> 


Resolving patch:
diff --git a/source/fileUtils.py b/source/fileUtils.py
--- a/source/fileUtils.py
+++ b/source/fileUtils.py
@@ -18,6 +18,7 @@ def FaultTolerantFile(name):
 	file `name' when the context manager scope ends and the the context manager __exit__ is called. This
 	means writing out the complete file can be performed with less concern of corrupting the original file
 	if the process is interrupted by windows shutting down.
+	`name` must be unicode.
 
 	Usage:
 		with FaultTolerantFile("myFile.txt") as f:
@@ -26,6 +27,8 @@ def FaultTolerantFile(name):
 	This creates a temporary file, and the writes actually happen on this temp file. At the end of the 
 	`with` block, when `f` goes out of context the temporary file is closed and, this temporary file replaces "myFile.txt"
 	'''
+	if not isinstance(name, unicode):
+		raise TypeError("name must be unicode")
 	dirpath, filename = os.path.split(name)
 	with NamedTemporaryFile(dir=dirpath, prefix=filename, suffix='.tmp', delete=False) as f:
 		log.debug(f.name)


Test patch:
Repository: nvaccess/nvda

Issue:
Outlook 2016 flagged items are not read in the message list
In the Message List, flagged mails are not read as flagged. This is a property/column just as from, subject and date



Discussion:
Yes, I confirm that I am experiencing the same.

Can confirm with Outlook 2016 and NVDA 2016.2.1. Flag/Completed status not announced in the message list. Only way to inquire such information is to open the message and read the "info bar" in the message header. 


Resolving patch:
diff --git a/source/appModules/outlook.py b/source/appModules/outlook.py
--- a/source/appModules/outlook.py
+++ b/source/appModules/outlook.py
@@ -29,6 +29,27 @@
 from NVDAObjects.behaviors import RowWithFakeNavigation
 from NVDAObjects.UIA import UIA
 
+oleFlagIconLabels={
+	# Translators: a flag for a Microsoft Outlook message
+	# See https://msdn.microsoft.com/en-us/library/office/aa211991(v=office.11).aspx
+	1:_("purple flag"),
+	# Translators: a flag for a Microsoft Outlook message
+	# See https://msdn.microsoft.com/en-us/library/office/aa211991(v=office.11).aspx
+	2:_("Orange flag"),
+	# Translators: a flag for a Microsoft Outlook message
+	# See https://msdn.microsoft.com/en-us/library/office/aa211991(v=office.11).aspx
+	3:_("Green flag"),
+	# Translators: a flag for a Microsoft Outlook message
+	# See https://msdn.microsoft.com/en-us/library/office/aa211991(v=office.11).aspx
+	4:_("Yellow flag"),
+	# Translators: a flag for a Microsoft Outlook message
+	# See https://msdn.microsoft.com/en-us/library/office/aa211991(v=office.11).aspx
+	5:_("Blue flag"),
+	# Translators: a flag for a Microsoft Outlook message
+	# See https://msdn.microsoft.com/en-us/library/office/aa211991(v=office.11).aspx
+	6:_("Red flag"),
+}
+
 importanceLabels={
 	# Translators: for a high importance email
 	2:_("high importance"),
@@ -391,6 +412,12 @@ def _get_name(self):
 				unread=False
 			# Translators: when an email is unread
 			if unread: textList.append(_("unread"))
+			try:
+				flagIcon=selection.flagIcon
+			except COMError:
+				flagIcon=0
+			flagIconLabel=oleFlagIconLabels.get(flagIcon)
+			if flagIconLabel: textList.append(flagIconLabel)
 			try:
 				attachmentCount=selection.attachments.count
 			except COMError:


Test patch:
Repository: nvaccess/nvda

Issue:
Excel border reporting is too verbose by default
From the [comment](https://github.com/nvaccess/nvda/issues/3044#issuecomment-289722547) by @leonardder:

Referring to the issue: "no information about the cell border is given in an Excel sheet, if the cell border is different from the adjacent cells. #3044"

> I believe the defaults for this are too verbose. I think both reporting of styles and colors should be initially off. Style and color information should only be reported whenever requested specifically, either by pressing nvda+f or enabling the particular options in the document formatting dialog.


Discussion:
It might be worth considering why the reporting styles and colors is on by default. Is there a historical reason, can anyone comment on this?
I don't know why it's on by default, but I also think it's too verbose. Besides, it's now read before the cell contents, which is a suboptimal order in my oppinion.

Resolving patch:
diff --git a/source/config/configSpec.py b/source/config/configSpec.py
--- a/source/config/configSpec.py
+++ b/source/config/configSpec.py
@@ -155,8 +155,8 @@
 	includeLayoutTables = boolean(default=False)
 	reportTableHeaders = boolean(default=True)
 	reportTableCellCoords = boolean(default=True)
-	reportBorderStyle = boolean(default=True)
-	reportBorderColor = boolean(default=True)
+	reportBorderStyle = boolean(default=False)
+	reportBorderColor = boolean(default=False)
 	reportLinks = boolean(default=true)
 	reportComments = boolean(default=true)
 	reportLists = boolean(default=true)


Test patch: