Repository: nvaccess/nvda

Issue:
Python 3: Erorr on the Windows 10 lock screen
### Steps to reproduce:
End up at the lock screen after an update with auto logon enabled.

### Actual behavior:
The following error is written to the log when starting to navigate:

```
ERROR - appModuleHandler.fetchAppModule (08:27:25.426):
error in appModule 'lockapp'
Traceback (most recent call last):
  File "appModuleHandler.pyc", line 173, in fetchAppModule
  File "importlib\__init__.pyc", line 127, in import_module
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
  File "appModules\lockapp.pyc", line 25, in <module>
  File "appModules\lockapp.pyc", line 37, in AppModule
AttributeError: 'function' object has no attribute '__func__'
```

### Expected behavior:
No error

### System configuration
#### NVDA installed/portable/running from source:
Installed

#### NVDA version:
threshold_py3_staging-17954

#### Windows version:
Windows 10.0.18932.1000

#### Other information about your system:
Insider build



Discussion:

Resolving patch:
diff --git a/source/appModules/lockapp.py b/source/appModules/lockapp.py
--- a/source/appModules/lockapp.py
+++ b/source/appModules/lockapp.py
@@ -34,54 +34,55 @@ def event_NVDAObject_init(self, obj):
 			obj.parent = None
 
 	SAFE_SCRIPTS = {
-		GlobalCommands.script_reportCurrentFocus.__func__,
-		GlobalCommands.script_title.__func__,
-		GlobalCommands.script_dateTime.__func__,
-		GlobalCommands.script_say_battery_status.__func__,
-		GlobalCommands.script_navigatorObject_current.__func__,
-		GlobalCommands.script_navigatorObject_currentDimensions.__func__,
-		GlobalCommands.script_navigatorObject_toFocus.__func__,
-		GlobalCommands.script_navigatorObject_moveFocus.__func__,
-		GlobalCommands.script_navigatorObject_parent.__func__,
-		GlobalCommands.script_navigatorObject_next.__func__,
-		GlobalCommands.script_navigatorObject_previous.__func__,
-		GlobalCommands.script_navigatorObject_firstChild.__func__,
-		GlobalCommands.script_review_activate.__func__,
-		GlobalCommands.script_review_top.__func__,
-		GlobalCommands.script_review_previousLine.__func__,
-		GlobalCommands.script_review_currentLine.__func__,
-		GlobalCommands.script_review_nextLine.__func__,
-		GlobalCommands.script_review_bottom.__func__,
-		GlobalCommands.script_review_previousWord.__func__,
-		GlobalCommands.script_review_currentWord.__func__,
-		GlobalCommands.script_review_nextWord.__func__,
-		GlobalCommands.script_review_startOfLine.__func__,
-		GlobalCommands.script_review_previousCharacter.__func__,
-		GlobalCommands.script_review_currentCharacter.__func__,
-		GlobalCommands.script_review_nextCharacter.__func__,
-		GlobalCommands.script_review_endOfLine.__func__,
-		GlobalCommands.script_review_sayAll.__func__,
-		GlobalCommands.script_braille_scrollBack.__func__,
-		GlobalCommands.script_braille_scrollForward.__func__,
-		GlobalCommands.script_braille_routeTo.__func__,
-		GlobalCommands.script_braille_previousLine.__func__,
-		GlobalCommands.script_braille_nextLine.__func__,
-		GlobalCommands.script_navigatorObject_nextInFlow.__func__,
-		GlobalCommands.script_navigatorObject_previousInFlow.__func__,
-		GlobalCommands.script_touch_changeMode.__func__,
-		GlobalCommands.script_touch_newExplore.__func__,
-		GlobalCommands.script_touch_explore.__func__,
-		GlobalCommands.script_touch_hoverUp.__func__,
-		GlobalCommands.script_moveMouseToNavigatorObject.__func__,
-		GlobalCommands.script_moveNavigatorObjectToMouse.__func__,
-		GlobalCommands.script_leftMouseClick.__func__,
-		GlobalCommands.script_rightMouseClick.__func__,
+		GlobalCommands.script_reportCurrentFocus,
+		GlobalCommands.script_title,
+		GlobalCommands.script_dateTime,
+		GlobalCommands.script_say_battery_status,
+		GlobalCommands.script_navigatorObject_current,
+		GlobalCommands.script_navigatorObject_currentDimensions,
+		GlobalCommands.script_navigatorObject_toFocus,
+		GlobalCommands.script_navigatorObject_moveFocus,
+		GlobalCommands.script_navigatorObject_parent,
+		GlobalCommands.script_navigatorObject_next,
+		GlobalCommands.script_navigatorObject_previous,
+		GlobalCommands.script_navigatorObject_firstChild,
+		GlobalCommands.script_review_activate,
+		GlobalCommands.script_review_top,
+		GlobalCommands.script_review_previousLine,
+		GlobalCommands.script_review_currentLine,
+		GlobalCommands.script_review_nextLine,
+		GlobalCommands.script_review_bottom,
+		GlobalCommands.script_review_previousWord,
+		GlobalCommands.script_review_currentWord,
+		GlobalCommands.script_review_nextWord,
+		GlobalCommands.script_review_startOfLine,
+		GlobalCommands.script_review_previousCharacter,
+		GlobalCommands.script_review_currentCharacter,
+		GlobalCommands.script_review_nextCharacter,
+		GlobalCommands.script_review_endOfLine,
+		GlobalCommands.script_review_sayAll,
+		GlobalCommands.script_braille_scrollBack,
+		GlobalCommands.script_braille_scrollForward,
+		GlobalCommands.script_braille_routeTo,
+		GlobalCommands.script_braille_previousLine,
+		GlobalCommands.script_braille_nextLine,
+		GlobalCommands.script_navigatorObject_nextInFlow,
+		GlobalCommands.script_navigatorObject_previousInFlow,
+		GlobalCommands.script_touch_changeMode,
+		GlobalCommands.script_touch_newExplore,
+		GlobalCommands.script_touch_explore,
+		GlobalCommands.script_touch_hoverUp,
+		GlobalCommands.script_moveMouseToNavigatorObject,
+		GlobalCommands.script_moveNavigatorObjectToMouse,
+		GlobalCommands.script_leftMouseClick,
+		GlobalCommands.script_rightMouseClick,
 	}
 	def _inputCaptor(self, gesture):
 		script = gesture.script
 		if not script:
 			return True
 		# Only allow specific scripts so people can't touch the clipboard, change NVDA config, etc.
+		# #9883: script is a bound method, __func__ gives us the underlying function.
 		return script.__func__ in self.SAFE_SCRIPTS
 
 	def event_appModule_gainFocus(self):


Test patch: