Suppress encoding conversion for compileall actions which are used for plugin installation.

Sun, 23 Aug 2015 11:43:34 +0200

author
T.Rzepka <Tobias.Rzepka@gmail.com>
date
Sun, 23 Aug 2015 11:43:34 +0200
changeset 4386
510090f78d0a
parent 4385
599681bf149a
child 4388
41c5865695b0

Suppress encoding conversion for compileall actions which are used for plugin installation.

PluginManager/PluginInstallDialog.py file | annotate | diff | comparison | revisions
diff -r 599681bf149a -r 510090f78d0a PluginManager/PluginInstallDialog.py
--- a/PluginManager/PluginInstallDialog.py	Sun Aug 23 11:37:17 2015 +0200
+++ b/PluginManager/PluginInstallDialog.py	Sun Aug 23 11:43:34 2015 +0200
@@ -469,10 +469,15 @@
         
         # now compile the plugins
         if doCompile:
-            compileall.compile_dir(
-                os.path.join(destination, packageName), quiet=True)
-            compileall.compile_file(
-                os.path.join(destination, pluginFileName), quiet=True)
+            dir = os.path.join(destination, packageName)
+            files = os.path.join(destination, pluginFileName)
+            if sys.version_info[0] == 2:
+                dir = dir.encode(sys.getfilesystemencoding())
+                files = files.encode(sys.getfilesystemencoding())
+            os.path.join_unicode = False
+            compileall.compile_dir(dir, quiet=True)
+            compileall.compile_file(files, quiet=True)
+            os.path.join_unicode = True
         
         if not self.__external:
             # now load and activate the plugin

eric ide

mercurial