Repository: nvaccess/nvda

Issue:
TypeError when processing presentationalRowNumber

### Steps to reproduce:
Start a copy of nvda beta/Alpha/Threshold (date of ticket 12th may 19)
### Actual behavior:
Run for a while then  restart and look at the old log. There are a lot, and I mean a lot of warnings about a parameter  error of some kind no matter what is on the screen.
Note slight slowing of nvda. even though no add ons are running.
### Expected behavior:
NVDA should run with very few error warnings as per the stable version
.
### System configuration
Windows 7 64bit pro. Running on a four core 3.2ghz processor system with 8 gigs of ram and 256gig ssd with 1tb data drive

#### NVDA installed/portable/running from source:
Portable
#### NVDA version:
In this particular test.
NVDA version beta-17277,7ecb8de3

#### Windows version:
7 64bit pro fully up to date with may 19 updates
#### Name and version of other software in use when reproducing the issue:
Almost anything but tried on desktop, tray iconsand Email software below
#### Other information about your system:
Intel chipped system.
### Other questions
#### Does the issue still occur after restarting your PC?
yes
#### Have you tried any other versions of NVDA? If so, please report their behaviors.
All snap versions in latest incarnations as on date above. All have the same issue
Stable is fine, no such errors 2019.1.1
Log extracts for clarity below. 
 
Edited log extracts to show warnings.

INFO - core.main (08:51:05.598):
NVDA version beta-17277,7ecb8de3
INFO - core.main (08:51:05.598):
Using Windows version 6.1.7601 service pack 1 workstation
INFO - core.main (08:51:05.598):
Using Python version 2.7.16 (v2.7.16:413a49145e, Mar  4 2019, 01:30:55) [MSC v.1500 32 bit (Intel)]
INFO - core.main (08:51:05.598):
Using comtypes version 1.1.7
INFO - core.main (08:51:05.598):
Using configobj version 5.1.0 with validate version 1.0.1
DEBUG - core.main (08:51:05.598):
Initializing add-ons system
DEBUG - addonHandler._getAvailableAddonsFromPath (08:51:05.598):
Listing add-ons from C:\nvda release candidate\userConfig\addons
DEBUG - addonHandler._getAvailableAddonsFromPath (08:51:05.598):

snip of all the disabled add ons loading in...
INFO - core.main (08:51:05.615):
Add-ons are disabled. Restart NVDA to enable them.
DEBUGWARNING - touchHandler.touchSupported (08:51:05.668):
Touch only supported on installed copies
DEBUG - core.main (08:51:05.721):
Initializing appModule Handler
DEBUG - core.main (08:51:05.721):
Initializing NVDAHelper
DEBUG - core.main (08:51:05.739):
Speech Dictionary processing
DEBUG - speechDictHandler.SpeechDict.load (08:51:05.739):
Loading speech dictionary '.\userConfig\speechDicts\default.dic'...
DEBUG - speechDictHandler.SpeechDict.load (08:51:05.739):
file '.\userConfig\speechDicts\default.dic' not found.
DEBUG - speechDictHandler.SpeechDict.load (08:51:05.739):
Loading speech dictionary 'builtin.dic'...
DEBUG - speechDictHandler.SpeechDict.load (08:51:05.740):
3 loaded records.
DEBUG - core.main (08:51:05.740):
Initializing speech
INFO - synthDrivers.espeak.SynthDriver.__init__ (08:51:05.750):
Using eSpeak NG version 1.49.3 dev
DEBUG - speechDictHandler.SpeechDict.load (08:51:05.782):
Loading speech dictionary '.\userConfig\speechDicts\voiceDicts.v1\espeak\espeak-English (Great Britain).dic'...
DEBUG - speechDictHandler.SpeechDict.load (08:51:05.782):
9 loaded records.
DEBUG - synthDriverHandler.SynthDriver.loadSettings (08:51:05.783):
Loaded settings for SynthDriver espeak
INFO - synthDriverHandler.setSynth (08:51:05.783):
Loaded synthDriver espeak
INFO - core.main (08:51:05.783):
Using wx version 4.0.3 msw (phoenix) wxWidgets 3.0.5
DEBUG - core.main (08:51:05.785):
Initializing braille input
INFO - brailleInput.initialize (08:51:05.785):
Braille input initialized
DEBUG - core.main (08:51:05.785):
Initializing braille
INFO - braille.initialize (08:51:05.786):
Using liblouis version 3.9.0
INFO - braille.BrailleHandler.setDisplayByName (08:51:05.789):
Loaded braille display driver noBraille, current display has 0 cells.
DEBUG - core.main (08:51:05.789):
Initializing displayModel
DEBUG - core.main (08:51:05.789):
Initializing GUI
DEBUG - core.main (08:51:05.799):
initializing Java Access Bridge support
WARNING - core.main (08:51:05.801):
Java Access Bridge not available
DEBUG - core.main (08:51:05.801):
Initializing winConsole support
DEBUG - core.main (08:51:05.801):
Initializing UIA support
INFO - _UIAHandler.UIAHandler.MTAThreadFunc (08:51:05.805):
UIAutomation: IUIAutomation
DEBUG - core.main (08:51:06.016):
Initializing IAccessible support
DEBUG - core.main (08:51:06.016):
Initializing input core
DEBUGWARNING - inputCore.InputManager.loadLocaleGestureMap (08:51:06.016):
No locale gesture map for language en
DEBUG - core.main (08:51:06.017):
Initializing keyboard handler
DEBUG - core.main (08:51:06.019):
initializing mouse handler
DEBUG - core.main (08:51:06.035):
Initializing touchHandler
DEBUGWARNING - touchHandler.touchSupported (08:51:06.036):
Touch only supported on installed copies
DEBUG - core.main (08:51:06.036):
Initializing global plugin handler
DEBUG - core.main (08:51:06.036):
Initializing core pump
DEBUG - core.main (08:51:06.038):
Initializing watchdog
DEBUG - core.main (08:51:06.038):
initializing updateCheck
INFO - core.main (08:51:06.039):
NVDA initialized
DEBUG - core.main (08:51:06.039):
entering wx application main loop
DEBUGWARNING - NVDAObjects.IAccessible.IAccessible._get_presentationalColumnNumber (08:51:06.072):
value None is not an int
Traceback (most recent call last):
  File "NVDAObjects\IAccessible\__init__.pyc", line 1160, in _get_presentationalColumnNumber
TypeError: int() argument must be a string or a number, not 'NoneType'
DEBUGWARNING - NVDAObjects.IAccessible.IAccessible._get_presentationalRowNumber (08:51:06.072):
value None is not an int
Traceback (most recent call last):
  File "NVDAObjects\IAccessible\__init__.pyc", line 1111, in _get_presentationalRowNumber
TypeError: int() argument must be a string or a number, not 'NoneType'
IO - speech.speak (08:51:06.073):
Speaking [LangChangeCommand ('en_GB'), u'4 nvda issues list - Outlook Express - Brians lists account BGlists']
No idea about his next error, nothing to do with the main thrust of this issue, I don't think.


DEBUGWARNING - characterProcessing._getSpeechSymbolsForLocale (08:51:06.073):
No CLDR data for locale en_GB

So back to the repeating error

DEBUGWARNING - NVDAObjects.IAccessible.IAccessible._get_presentationalColumnNumber (08:51:06.207):
value None is not an int
Traceback (most recent call last):
  File "NVDAObjects\IAccessible\__init__.pyc", line 1160, in _get_presentationalColumnNumber
TypeError: int() argument must be a string or a number, not 'NoneType'
DEBUGWARNING - NVDAObjects.IAccessible.IAccessible._get_presentationalRowNumber (08:51:06.207):
value None is not an int
Traceback (most recent call last):
  File "NVDAObjects\IAccessible\__init__.pyc", line 1111, in _get_presentationalRowNumber
TypeError: int() argument must be a string or a number, not 'NoneType'
IO - speech.speak (08:51:06.207):
Speaking [LangChangeCommand ('en_GB'), u'Outlook Express Message List  list']

As  you can tell that was the email  software but...
snip...
tray icons

IO - inputCore.InputManager.executeGesture (08:57:35.651):
Input: kb(desktop):downArrow
DEBUGWARNING - NVDAObjects.IAccessible.IAccessible._get_presentationalColumnNumber (08:57:35.688):
value None is not an int
Traceback (most recent call last):
  File "NVDAObjects\IAccessible\__init__.pyc", line 1160, in _get_presentationalColumnNumber
TypeError: int() argument must be a string or a number, not 'NoneType'
DEBUGWARNING - NVDAObjects.IAccessible.IAccessible._get_presentationalRowNumber (08:57:35.690):
value None is not an int
Traceback (most recent call last):
  File "NVDAObjects\IAccessible\__init__.pyc", line 1111, in _get_presentationalRowNumber
TypeError: int() argument must be a string or a number, not 'NoneType'
IO - speech.speak (08:57:35.690):
Speaking [LangChangeCommand ('en_GB'), u'PC status: Protected  button  6 of 7']
DEBUGWARNING - NVDAObjects.IAccessible.IAccessible._get_presentationalColumnNumber (08:57:36.687):
value None is not an int
Traceback (most recent call last):
  File "NVDAObjects\IAccessible\__init__.pyc", line 1160, in _get_presentationalColumnNumber
TypeError: int() argument must be a string or a number, not 'NoneType'
DEBUGWARNING - NVDAObjects.IAccessible.IAccessible._get_presentationalRowNumber (08:57:36.690):
value None is not an int
Traceback (most recent call last):
  File "NVDAObjects\IAccessible\__init__.pyc", line 1111, in _get_presentationalRowNumber
TypeError: int() argument must be a string or a number, not 'NoneType'
IO - speech.speak (08:57:36.693):
Speaking [LangChangeCommand ('en_GB'), u'PC status: Protected  tool tip']

This story repeats on almost everything I try, including the desktop.
 It feels like nvda is sluggish to me, and this same issue is on alpha and threshold as well as beta.
 I hope this has been of help.
Brian


Discussion:
This looks like a regression caused by #9562

Cc @michaeldcurran

Resolving patch:
diff --git a/source/NVDAObjects/IAccessible/__init__.py b/source/NVDAObjects/IAccessible/__init__.py
--- a/source/NVDAObjects/IAccessible/__init__.py
+++ b/source/NVDAObjects/IAccessible/__init__.py
@@ -1107,12 +1107,12 @@ def _get_presentationalRowNumber(self):
 		index=self.IA2Attributes.get('rowindex')
 		if index is None and isinstance(self.parent,IAccessible):
 			index=self.parent.IA2Attributes.get('rowindex')
+		if index is None:
+			raise NotImplementedError
 		try:
 			index=int(index)
 		except (ValueError,TypeError):
 			log.debugWarning("value %s is not an int"%index,exc_info=True)
-			index=None
-		if index is None:
 			raise NotImplementedError
 		return index
 
@@ -1156,12 +1156,12 @@ def _get_cellCoordsText(self):
 
 	def _get_presentationalColumnNumber(self):
 		index=self.IA2Attributes.get('colindex')
+		if index is None:
+			raise NotImplementedError
 		try:
 			index=int(index)
 		except (ValueError,TypeError):
 			log.debugWarning("value %s is not an int"%index,exc_info=True)
-			index=None
-		if index is None:
 			raise NotImplementedError
 		return index
 
@@ -1185,12 +1185,12 @@ def _get_rowCount(self):
 
 	def _get_presentationalRowCount(self):
 		count=self.IA2Attributes.get('rowcount')
+		if count is None:
+			raise NotImplementedError
 		try:
 			count=int(count)
 		except (ValueError,TypeError):
 			log.debugWarning("value %s is not an int"%count,exc_info=True)
-			count=None
-		if count is None:
 			raise NotImplementedError
 		return count
 
@@ -1209,12 +1209,12 @@ def _get_columnCount(self):
 
 	def _get_presentationalColumnCount(self):
 		count=self.IA2Attributes.get('colcount')
+		if count is None:
+			raise NotImplementedError
 		try:
 			count=int(count)
 		except (ValueError,TypeError):
 			log.debugWarning("value %s is not an int"%count,exc_info=True)
-			count=None
-		if count is None:
 			raise NotImplementedError
 		return count
 


Test patch: