]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/samples/ide/activegrid/tool/process.py
removed code inside USE_SIZABLE_CALENDAR, we should allow making the main calendar...
[wxWidgets.git] / wxPython / samples / ide / activegrid / tool / process.py
index 691c1396991e3bff88f4ebdbe5f936f8e39c1721..1de68e1bc91eeda0f3470bdffa1d4f8455ba123d 100644 (file)
@@ -407,7 +407,13 @@ _SaferCreateProcess(appName=%r,
                 elif env:
                     uenv = {}
                     for key, val in env.items():
-                        uenv[unicode(key)] = unicode(val)
+                        try:
+                            uenv[unicode(key)] = unicode(val)   # default encoding
+                        except UnicodeError:
+                            try:
+                                uenv[unicode(key, 'iso-8859-1')] = unicode(val, 'iso-8859-1')   # backup encoding
+                            except UnicodeError:
+                                log.warn('Skipping environment variable "%s" in execution process: unable to convert to unicode using either the default encoding or ISO-8859-1' % (key))
                     env = uenv
                 hProcess, hThread, processId, threadId\
                     = win32process.CreateProcess(appName, cmd, processSA,
@@ -1924,7 +1930,7 @@ class IOBuffer:
 
         self.__buf = ''
         # A state change is defined as the buffer being closed or a
-        # write occurring.
+        # write occuring.
         if mutex is not None:
             self._mutex = mutex
         else: