Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NVDA no longer fails to install if the user's profile path contains c…
…ertain multibyte characters. Another fix for #2729. Instead of monkeypatching Python's tempfile module only in nvda.pyw, moe this code in to a new pythonMonkeyPatches module and import it (apply them) from both nvda.pyw and nvda_slave.pyw.
- Loading branch information
1 parent
c790f84
commit c0c5b69
Showing
4 changed files
with
20 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#A part of NonVisual Desktop Access (NVDA) | ||
#Copyright (C) 2006-2013 NVDA Contributors <http://www.nvda-project.org/> | ||
#This file is covered by the GNU General Public License. | ||
#See the file COPYING for more details. | ||
|
||
"""Fixes some broken features in Python such as gettempdir""" | ||
|
||
# #2729: Python's tempfile.get_default_tempdir() has a bug when handling multibyte paths. os.path.normcase is used incorrectly. | ||
# Override this to use the temp path as returned by Windows. | ||
import ctypes | ||
import tempfile | ||
tempPath = ctypes.create_string_buffer(260) | ||
if ctypes.windll.kernel32.GetTempPathA(260, tempPath) > 0: | ||
# Strip trailing backslash which is always included. | ||
tempfile.tempdir = tempPath.value[:-1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters