OSDN Git Service

NVDA no longer fails to install if the user's profile path contains certain multibyte...
authorMichael Curran <mick@kulgan.net>
Fri, 1 Feb 2013 18:45:15 +0000 (04:45 +1000)
committerMichael Curran <mick@kulgan.net>
Fri, 1 Feb 2013 18:45:15 +0000 (04:45 +1000)
source/nvda.pyw
source/nvda_slave.pyw
source/pythonMonkeyPatches.py [new file with mode: 0644]
user_docs/en/changes.t2t

index 5bf6d43..6e4f4a0 100755 (executable)
@@ -6,16 +6,9 @@
 \r
 """The NVDA launcher. It can handle some command-line arguments (including help). It sets up logging, and then starts the core."""\r
 \r
-import ctypes\r
-\r
-# #2729: Python's tempfile.get_default_tempdir() has a bug when handling multibyte paths. os.path.normcase is used incorrectly.\r
-# Override this to use the temp path as returned by Windows.\r
-import tempfile\r
-tempPath = ctypes.create_string_buffer(260)\r
-if ctypes.windll.kernel32.GetTempPathA(260, tempPath) > 0:\r
-       # Strip trailing backslash which is always included.\r
-       tempfile.tempdir = tempPath.value[:-1]\r
+import pythonMonkeyPatches\r
 \r
+import ctypes\r
 import os\r
 import sys\r
 import locale\r
index 042dc8d..5b6c273 100755 (executable)
@@ -2,6 +2,8 @@
 Performs miscellaneous tasks which need to be performed in a separate process.\r
 """\r
 \r
+import pythonMonkeyPatches\r
+\r
 import sys\r
 import os\r
 import logHandler\r
diff --git a/source/pythonMonkeyPatches.py b/source/pythonMonkeyPatches.py
new file mode 100644 (file)
index 0000000..41f3996
--- /dev/null
@@ -0,0 +1,15 @@
+#A part of NonVisual Desktop Access (NVDA)\r
+#Copyright (C) 2006-2013 NVDA Contributors <http://www.nvda-project.org/>\r
+#This file is covered by the GNU General Public License.\r
+#See the file COPYING for more details.\r
+\r
+"""Fixes some broken features in Python such as gettempdir"""\r
+\r
+# #2729: Python's tempfile.get_default_tempdir() has a bug when handling multibyte paths. os.path.normcase is used incorrectly.\r
+# Override this to use the temp path as returned by Windows.\r
+import ctypes\r
+import tempfile\r
+tempPath = ctypes.create_string_buffer(260)\r
+if ctypes.windll.kernel32.GetTempPathA(260, tempPath) > 0:\r
+       # Strip trailing backslash which is always included.\r
+       tempfile.tempdir = tempPath.value[:-1]\r
index a991e88..1cce4c4 100644 (file)
@@ -47,6 +47,7 @@
 - Text selection is now correctly shown on a braille display in applications such as Microsoft word 2003 and Internet Explorer edit controls.\r
 - It is again possible to select text in a backward direction in Microsoft Word while Braille is enabled.\r
 - When reviewing,  backspacing or deleting characters  In Scintilla edit controls, NVDA correctly announces multibyte characters. (#2855)\r
+- NVDA will no longer fail to install when the user's profile path contains certain multibyte characters. (#2729)\r
 \r
 \r
 == Changes for Developers ==\r