Author: forenr
Date: Tue Mar  6 22:24:04 2012
New Revision: 40875
URL: http://www.lyx.org/trac/changeset/40875

Log:
On Windows, properly account for the encoding of the temporary directory.

Modified:
   lyx-devel/branches/BRANCH_2_0_X/lib/configure.py
   lyx-devel/branches/BRANCH_2_0_X/status.20x

Modified: lyx-devel/branches/BRANCH_2_0_X/lib/configure.py
==============================================================================
--- lyx-devel/branches/BRANCH_2_0_X/lib/configure.py    Tue Mar  6 11:39:01 
2012        (r40874)
+++ lyx-devel/branches/BRANCH_2_0_X/lib/configure.py    Tue Mar  6 22:24:04 
2012        (r40875)
@@ -109,9 +109,13 @@
         from tempfile import mkstemp
         fd, tmpfname = mkstemp(suffix='.ltx')
         if os.name == 'nt':
+            from locale import getdefaultlocale
             from ctypes import windll, create_unicode_buffer
             GetShortPathName = windll.kernel32.GetShortPathNameW
-            longname = unicode(tmpfname)
+            language, encoding = getdefaultlocale()
+            if encoding == None:
+                encoding = 'latin1'
+            longname = unicode(tmpfname, encoding)
             shortlen = GetShortPathName(longname, 0, 0)
             shortname = create_unicode_buffer(shortlen)
             if GetShortPathName(longname, shortname, shortlen):

Modified: lyx-devel/branches/BRANCH_2_0_X/status.20x
==============================================================================
--- lyx-devel/branches/BRANCH_2_0_X/status.20x  Tue Mar  6 11:39:01 2012        
(r40874)
+++ lyx-devel/branches/BRANCH_2_0_X/status.20x  Tue Mar  6 22:24:04 2012        
(r40875)
@@ -62,6 +62,9 @@
 
 - Fix pasting of LATIN CAPITAL LETTER SHARP S (bug 8057).
 
+- Fix reconfiguration on Windows when the temporary directory used by
+  python contains non-ascii characters.
+
 
 * TEX2LYX
 

Reply via email to