We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
word problems 2013 

### Steps to reproduce:
I have a friend's computer with problems.
This machine is with office 2013 and windows 10, I didn't install these 2 software.
I updated on this machine only nvda and the add-ons.
In several parts of the word, nvda doesn't say anything:
When we press alt inside word nvda doesn't announce the focus in the menu, and when we walk with tabe it doesn't read anything either.
This also occurred within outlook.
When we close the document without saving in the word question if we want to save the changes when walking with tabe again, nvda does not announce anything.
When opening the word on the first screen where you can choose the type of document to create nvda again is muted when walking with tabe or arrows.
I've already tested it with disabled add-ons and the problem continued.
I already ran the registry fix tool with and the error continues.
Nvda seems to work well in any other area of windows 10 and other programs. 
### Actual behavior:
nvda mute on some word screens 
### Expected behavior:
nvda read screens normally 
### System configuration
#### NVDA installed/portable/running from source:
instaled
#### NVDA version:
alfa 24160
#### Windows version:
10 10.0.19043.
#### Name and version of other software in use when reproducing the issue:
office 2013
#### 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 NVDA 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
log of the various screens where I noticed the error.
Sorry, there are so many errors that I couldn't selessionar only the point where it matters in the log, but I tried to turn on nvda at the time the error occurs to be relatively smaller. 
[exit word.txt](https://github.com/nvaccess/nvda/files/7445713/exit.word.txt)
[select word.txt](https://github.com/nvaccess/nvda/files/7445714/select.word.txt)
[start word.txt](https://github.com/nvaccess/nvda/files/7445715/start.word.txt)


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `source/fileUtils.py`
Content:
```
1 # A part of NonVisual Desktop Access (NVDA)
2 # Copyright (C) 2017-2021 NV Access Limited, Bram Duvigneau, Łukasz Golonka
3 # This file is covered by the GNU General Public License.
4 # See the file COPYING for more details.
5 
6 import os
7 import ctypes
8 import ctypes.wintypes
9 import array
10 from contextlib import contextmanager
11 from tempfile import NamedTemporaryFile
12 from logHandler import log
13 from six import text_type
14 import winKernel
15 import shlobj
16 from functools import wraps
17 import systemUtils
18 
19 
20 @contextmanager
21 def FaultTolerantFile(name):
22 	'''Used to write out files in a more fault tolerant way. A temporary file is used, and replaces the 
23 	file `name' when the context manager scope ends and the the context manager __exit__ is called. This
24 	means writing out the complete file can be performed with less concern of corrupting the original file
25 	if the process is interrupted by windows shutting down.
26 	`name` must be unicode.
27 
28 	Usage:
29 		with FaultTolerantFile("myFile.txt") as f:
30 			f.write("This is a test")
31 
32 	This creates a temporary file, and the writes actually happen on this temp file. At the end of the 
33 	`with` block, when `f` goes out of context the temporary file is closed and, this temporary file replaces "myFile.txt"
34 	'''
35 	if not isinstance(name, text_type):
36 		raise TypeError("name must be an unicode string")
37 	dirpath, filename = os.path.split(name)
38 	with NamedTemporaryFile(dir=dirpath, prefix=filename, suffix='.tmp', delete=False) as f:
39 		log.debug(f.name)
40 		yield f
41 		f.flush()
42 		os.fsync(f)
43 		f.close()
44 		winKernel.moveFileEx(f.name, name, winKernel.MOVEFILE_REPLACE_EXISTING)
45 
46 
47 def _suspendWow64RedirectionForFileInfoRetrieval(func):
48 	"""
49 	This decorator checks if the file provided as a `filePath`
50 	is placed in a system32 directory, and if for the current system system32
51 	redirects 32-bit processes such as NVDA to a different syswow64 directory
52 	disables redirection for the duration of the function call.
53 	This is necessary when fetching file version info since NVDA is a 32-bit application
54 	and without redirection disabled we would either access a wrong file or not be able to access it at all.
55 	"""
56 	@wraps(func)
57 	def funcWrapper(filePath, *attributes):
58 		nativeSys32 = shlobj.SHGetKnownFolderPath(shlobj.FolderId.SYSTEM)
59 		if (
60 			systemUtils.hasSyswow64Dir()
61 			# `os.path.commonpath` is necessary to perform case-insensitive comparisons
62 			and os.path.commonpath([nativeSys32]) == os.path.commonpath([nativeSys32, filePath])
63 		):
64 			with winKernel.suspendWow64Redirection():
65 				return func(filePath, *attributes)
66 		else:
67 			return func(filePath, *attributes)
68 	return funcWrapper
69 
70 
71 @_suspendWow64RedirectionForFileInfoRetrieval
72 def getFileVersionInfo(name, *attributes):
73 	"""Gets the specified file version info attributes from the provided file."""
74 	if not isinstance(name, text_type):
75 		raise TypeError("name must be an unicode string")
76 	if not os.path.exists(name):
77 		raise RuntimeError("The file %s does not exist" % name)
78 	fileVersionInfo = {}
79 	# Get size needed for buffer (0 if no info)
80 	size = ctypes.windll.version.GetFileVersionInfoSizeW(name, None)
81 	if not size:
82 		raise RuntimeError("No version information")
83 	# Create buffer
84 	res = ctypes.create_string_buffer(size)
85 	# Load file informations into buffer res
86 	ctypes.windll.version.GetFileVersionInfoW(name, None, size, res)
87 	r = ctypes.c_uint()
88 	l = ctypes.c_uint()
89 	# Look for codepages
90 	ctypes.windll.version.VerQueryValueW(res, u'\\VarFileInfo\\Translation',
91 		ctypes.byref(r), ctypes.byref(l))
92 	if not l.value:
93 		raise RuntimeError("No codepage")
94 	# Take the first codepage (what else ?)
95 	codepage = array.array('H', ctypes.string_at(r.value, 4))
96 	codepage = "%04x%04x" % tuple(codepage)
97 	for attr in attributes:
98 		if not ctypes.windll.version.VerQueryValueW(res,
99 			u'\\StringFileInfo\\%s\\%s' % (codepage, attr),
100 			ctypes.byref(r), ctypes.byref(l)
101 		):
102 			log.warning("Invalid or unavailable version info attribute for %r: %s" % (name, attr))
103 			fileVersionInfo[attr] = None
104 		else:
105 			fileVersionInfo[attr] = ctypes.wstring_at(r.value, l.value-1)
106 	return fileVersionInfo
107
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/source/fileUtils.py b/source/fileUtils.py
--- a/source/fileUtils.py
+++ b/source/fileUtils.py
@@ -58,8 +58,8 @@
 		nativeSys32 = shlobj.SHGetKnownFolderPath(shlobj.FolderId.SYSTEM)
 		if (
 			systemUtils.hasSyswow64Dir()
-			# `os.path.commonpath` is necessary to perform case-insensitive comparisons
-			and os.path.commonpath([nativeSys32]) == os.path.commonpath([nativeSys32, filePath])
+			# Path's returned from `appModule.appPath` and `shlobj.SHGetKnownFolderPath` often differ in case
+			and filePath.casefold().startswith(nativeSys32.casefold())
 		):
 			with winKernel.suspendWow64Redirection():
 				return func(filePath, *attributes)

{"golden_diff": "diff --git a/source/fileUtils.py b/source/fileUtils.py\n--- a/source/fileUtils.py\n+++ b/source/fileUtils.py\n@@ -58,8 +58,8 @@\n \t\tnativeSys32 = shlobj.SHGetKnownFolderPath(shlobj.FolderId.SYSTEM)\n \t\tif (\n \t\t\tsystemUtils.hasSyswow64Dir()\n-\t\t\t# `os.path.commonpath` is necessary to perform case-insensitive comparisons\n-\t\t\tand os.path.commonpath([nativeSys32]) == os.path.commonpath([nativeSys32, filePath])\n+\t\t\t# Path's returned from `appModule.appPath` and `shlobj.SHGetKnownFolderPath` often differ in case\n+\t\t\tand filePath.casefold().startswith(nativeSys32.casefold())\n \t\t):\n \t\t\twith winKernel.suspendWow64Redirection():\n \t\t\t\treturn func(filePath, *attributes)\n", "issue": "word problems 2013 \n\r\n### Steps to reproduce:\r\nI have a friend's computer with problems.\r\nThis machine is with office 2013 and windows 10, I didn't install these 2 software.\r\nI updated on this machine only nvda and the add-ons.\r\nIn several parts of the word, nvda doesn't say anything:\r\nWhen we press alt inside word nvda doesn't announce the focus in the menu, and when we walk with tabe it doesn't read anything either.\r\nThis also occurred within outlook.\r\nWhen we close the document without saving in the word question if we want to save the changes when walking with tabe again, nvda does not announce anything.\r\nWhen opening the word on the first screen where you can choose the type of document to create nvda again is muted when walking with tabe or arrows.\r\nI've already tested it with disabled add-ons and the problem continued.\r\nI already ran the registry fix tool with and the error continues.\r\nNvda seems to work well in any other area of windows 10 and other programs. \r\n### Actual behavior:\r\nnvda mute on some word screens \r\n### Expected behavior:\r\nnvda read screens normally \r\n### System configuration\r\n#### NVDA installed/portable/running from source:\r\ninstaled\r\n#### NVDA version:\r\nalfa 24160\r\n#### Windows version:\r\n10 10.0.19043.\r\n#### Name and version of other software in use when reproducing the issue:\r\noffice 2013\r\n#### Other information about your system:\r\n\r\n### Other questions\r\n#### Does the issue still occur after restarting your computer?\r\nyes\r\n#### Have you tried any other versions of NVDA? If so, please report their behaviors.\r\nno\r\n#### If NVDA add-ons are disabled, is your problem still occurring?\r\nyes\r\n#### Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?\r\nyes\r\nlog of the various screens where I noticed the error.\r\nSorry, there are so many errors that I couldn't selessionar only the point where it matters in the log, but I tried to turn on nvda at the time the error occurs to be relatively smaller. \r\n[exit word.txt](https://github.com/nvaccess/nvda/files/7445713/exit.word.txt)\r\n[select word.txt](https://github.com/nvaccess/nvda/files/7445714/select.word.txt)\r\n[start word.txt](https://github.com/nvaccess/nvda/files/7445715/start.word.txt)\r\n\n", "before_files": [{"content": "# A part of NonVisual Desktop Access (NVDA)\n# Copyright (C) 2017-2021 NV Access Limited, Bram Duvigneau, \u0141ukasz Golonka\n# This file is covered by the GNU General Public License.\n# See the file COPYING for more details.\n\nimport os\nimport ctypes\nimport ctypes.wintypes\nimport array\nfrom contextlib import contextmanager\nfrom tempfile import NamedTemporaryFile\nfrom logHandler import log\nfrom six import text_type\nimport winKernel\nimport shlobj\nfrom functools import wraps\nimport systemUtils\n\n\n@contextmanager\ndef FaultTolerantFile(name):\n\t'''Used to write out files in a more fault tolerant way. A temporary file is used, and replaces the \n\tfile `name' when the context manager scope ends and the the context manager __exit__ is called. This\n\tmeans writing out the complete file can be performed with less concern of corrupting the original file\n\tif the process is interrupted by windows shutting down.\n\t`name` must be unicode.\n\n\tUsage:\n\t\twith FaultTolerantFile(\"myFile.txt\") as f:\n\t\t\tf.write(\"This is a test\")\n\n\tThis creates a temporary file, and the writes actually happen on this temp file. At the end of the \n\t`with` block, when `f` goes out of context the temporary file is closed and, this temporary file replaces \"myFile.txt\"\n\t'''\n\tif not isinstance(name, text_type):\n\t\traise TypeError(\"name must be an unicode string\")\n\tdirpath, filename = os.path.split(name)\n\twith NamedTemporaryFile(dir=dirpath, prefix=filename, suffix='.tmp', delete=False) as f:\n\t\tlog.debug(f.name)\n\t\tyield f\n\t\tf.flush()\n\t\tos.fsync(f)\n\t\tf.close()\n\t\twinKernel.moveFileEx(f.name, name, winKernel.MOVEFILE_REPLACE_EXISTING)\n\n\ndef _suspendWow64RedirectionForFileInfoRetrieval(func):\n\t\"\"\"\n\tThis decorator checks if the file provided as a `filePath`\n\tis placed in a system32 directory, and if for the current system system32\n\tredirects 32-bit processes such as NVDA to a different syswow64 directory\n\tdisables redirection for the duration of the function call.\n\tThis is necessary when fetching file version info since NVDA is a 32-bit application\n\tand without redirection disabled we would either access a wrong file or not be able to access it at all.\n\t\"\"\"\n\t@wraps(func)\n\tdef funcWrapper(filePath, *attributes):\n\t\tnativeSys32 = shlobj.SHGetKnownFolderPath(shlobj.FolderId.SYSTEM)\n\t\tif (\n\t\t\tsystemUtils.hasSyswow64Dir()\n\t\t\t# `os.path.commonpath` is necessary to perform case-insensitive comparisons\n\t\t\tand os.path.commonpath([nativeSys32]) == os.path.commonpath([nativeSys32, filePath])\n\t\t):\n\t\t\twith winKernel.suspendWow64Redirection():\n\t\t\t\treturn func(filePath, *attributes)\n\t\telse:\n\t\t\treturn func(filePath, *attributes)\n\treturn funcWrapper\n\n\n@_suspendWow64RedirectionForFileInfoRetrieval\ndef getFileVersionInfo(name, *attributes):\n\t\"\"\"Gets the specified file version info attributes from the provided file.\"\"\"\n\tif not isinstance(name, text_type):\n\t\traise TypeError(\"name must be an unicode string\")\n\tif not os.path.exists(name):\n\t\traise RuntimeError(\"The file %s does not exist\" % name)\n\tfileVersionInfo = {}\n\t# Get size needed for buffer (0 if no info)\n\tsize = ctypes.windll.version.GetFileVersionInfoSizeW(name, None)\n\tif not size:\n\t\traise RuntimeError(\"No version information\")\n\t# Create buffer\n\tres = ctypes.create_string_buffer(size)\n\t# Load file informations into buffer res\n\tctypes.windll.version.GetFileVersionInfoW(name, None, size, res)\n\tr = ctypes.c_uint()\n\tl = ctypes.c_uint()\n\t# Look for codepages\n\tctypes.windll.version.VerQueryValueW(res, u'\\\\VarFileInfo\\\\Translation',\n\t\tctypes.byref(r), ctypes.byref(l))\n\tif not l.value:\n\t\traise RuntimeError(\"No codepage\")\n\t# Take the first codepage (what else ?)\n\tcodepage = array.array('H', ctypes.string_at(r.value, 4))\n\tcodepage = \"%04x%04x\" % tuple(codepage)\n\tfor attr in attributes:\n\t\tif not ctypes.windll.version.VerQueryValueW(res,\n\t\t\tu'\\\\StringFileInfo\\\\%s\\\\%s' % (codepage, attr),\n\t\t\tctypes.byref(r), ctypes.byref(l)\n\t\t):\n\t\t\tlog.warning(\"Invalid or unavailable version info attribute for %r: %s\" % (name, attr))\n\t\t\tfileVersionInfo[attr] = None\n\t\telse:\n\t\t\tfileVersionInfo[attr] = ctypes.wstring_at(r.value, l.value-1)\n\treturn fileVersionInfo\n", "path": "source/fileUtils.py"}], "after_files": [{"content": "# A part of NonVisual Desktop Access (NVDA)\n# Copyright (C) 2017-2021 NV Access Limited, Bram Duvigneau, \u0141ukasz Golonka\n# This file is covered by the GNU General Public License.\n# See the file COPYING for more details.\n\nimport os\nimport ctypes\nimport ctypes.wintypes\nimport array\nfrom contextlib import contextmanager\nfrom tempfile import NamedTemporaryFile\nfrom logHandler import log\nfrom six import text_type\nimport winKernel\nimport shlobj\nfrom functools import wraps\nimport systemUtils\n\n\n@contextmanager\ndef FaultTolerantFile(name):\n\t'''Used to write out files in a more fault tolerant way. A temporary file is used, and replaces the \n\tfile `name' when the context manager scope ends and the the context manager __exit__ is called. This\n\tmeans writing out the complete file can be performed with less concern of corrupting the original file\n\tif the process is interrupted by windows shutting down.\n\t`name` must be unicode.\n\n\tUsage:\n\t\twith FaultTolerantFile(\"myFile.txt\") as f:\n\t\t\tf.write(\"This is a test\")\n\n\tThis creates a temporary file, and the writes actually happen on this temp file. At the end of the \n\t`with` block, when `f` goes out of context the temporary file is closed and, this temporary file replaces \"myFile.txt\"\n\t'''\n\tif not isinstance(name, text_type):\n\t\traise TypeError(\"name must be an unicode string\")\n\tdirpath, filename = os.path.split(name)\n\twith NamedTemporaryFile(dir=dirpath, prefix=filename, suffix='.tmp', delete=False) as f:\n\t\tlog.debug(f.name)\n\t\tyield f\n\t\tf.flush()\n\t\tos.fsync(f)\n\t\tf.close()\n\t\twinKernel.moveFileEx(f.name, name, winKernel.MOVEFILE_REPLACE_EXISTING)\n\n\ndef _suspendWow64RedirectionForFileInfoRetrieval(func):\n\t\"\"\"\n\tThis decorator checks if the file provided as a `filePath`\n\tis placed in a system32 directory, and if for the current system system32\n\tredirects 32-bit processes such as NVDA to a different syswow64 directory\n\tdisables redirection for the duration of the function call.\n\tThis is necessary when fetching file version info since NVDA is a 32-bit application\n\tand without redirection disabled we would either access a wrong file or not be able to access it at all.\n\t\"\"\"\n\t@wraps(func)\n\tdef funcWrapper(filePath, *attributes):\n\t\tnativeSys32 = shlobj.SHGetKnownFolderPath(shlobj.FolderId.SYSTEM)\n\t\tif (\n\t\t\tsystemUtils.hasSyswow64Dir()\n\t\t\t# Path's returned from `appModule.appPath` and `shlobj.SHGetKnownFolderPath` often differ in case\n\t\t\tand filePath.casefold().startswith(nativeSys32.casefold())\n\t\t):\n\t\t\twith winKernel.suspendWow64Redirection():\n\t\t\t\treturn func(filePath, *attributes)\n\t\telse:\n\t\t\treturn func(filePath, *attributes)\n\treturn funcWrapper\n\n\n@_suspendWow64RedirectionForFileInfoRetrieval\ndef getFileVersionInfo(name, *attributes):\n\t\"\"\"Gets the specified file version info attributes from the provided file.\"\"\"\n\tif not isinstance(name, text_type):\n\t\traise TypeError(\"name must be an unicode string\")\n\tif not os.path.exists(name):\n\t\traise RuntimeError(\"The file %s does not exist\" % name)\n\tfileVersionInfo = {}\n\t# Get size needed for buffer (0 if no info)\n\tsize = ctypes.windll.version.GetFileVersionInfoSizeW(name, None)\n\tif not size:\n\t\traise RuntimeError(\"No version information\")\n\t# Create buffer\n\tres = ctypes.create_string_buffer(size)\n\t# Load file informations into buffer res\n\tctypes.windll.version.GetFileVersionInfoW(name, None, size, res)\n\tr = ctypes.c_uint()\n\tl = ctypes.c_uint()\n\t# Look for codepages\n\tctypes.windll.version.VerQueryValueW(res, u'\\\\VarFileInfo\\\\Translation',\n\t\tctypes.byref(r), ctypes.byref(l))\n\tif not l.value:\n\t\traise RuntimeError(\"No codepage\")\n\t# Take the first codepage (what else ?)\n\tcodepage = array.array('H', ctypes.string_at(r.value, 4))\n\tcodepage = \"%04x%04x\" % tuple(codepage)\n\tfor attr in attributes:\n\t\tif not ctypes.windll.version.VerQueryValueW(res,\n\t\t\tu'\\\\StringFileInfo\\\\%s\\\\%s' % (codepage, attr),\n\t\t\tctypes.byref(r), ctypes.byref(l)\n\t\t):\n\t\t\tlog.warning(\"Invalid or unavailable version info attribute for %r: %s\" % (name, attr))\n\t\t\tfileVersionInfo[attr] = None\n\t\telse:\n\t\t\tfileVersionInfo[attr] = ctypes.wstring_at(r.value, l.value-1)\n\treturn fileVersionInfo\n", "path": "source/fileUtils.py"}]}