File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ bool QgsPythonUtilsImpl::checkSystemImports()
82
82
// locally installed plugins have priority over the system plugins
83
83
// use os.path.expanduser to support usernames with special characters (see #2512)
84
84
QStringList pluginpaths;
85
- Q_FOREACH ( QString p, extraPluginsPaths () )
85
+ Q_FOREACH ( const QString& p, extraPluginsPaths () )
86
86
{
87
87
if ( !QDir ( p ).exists () )
88
88
{
@@ -97,7 +97,11 @@ bool QgsPythonUtilsImpl::checkSystemImports()
97
97
// we store here paths in unicode strings
98
98
// the str constant will contain utf8 code (through runString)
99
99
// so we call '...'.decode('utf-8') to make a unicode string
100
+ #if (PY_VERSION_HEX < 0x03000000)
100
101
pluginpaths << ' "' + p + " \" .decode('utf-8')" ;
102
+ #else
103
+ pluginpaths << ' "' + p + ' "' ;
104
+ #endif
101
105
}
102
106
pluginpaths << homePluginsPath ();
103
107
pluginpaths << ' "' + pluginsPath () + ' "' ;
Original file line number Diff line number Diff line change 23
23
import subprocess
24
24
import tempfile
25
25
import errno
26
+ import locale
26
27
27
28
from qgis .testing import unittest
28
29
from utilities import unitTestDataPath
@@ -118,6 +119,8 @@ def testPluginPath(self):
118
119
for t in ['test_plugins' , 'test plugins' , u'test_pluginsé€' ]:
119
120
120
121
# get a unicode test dir
122
+ if sys .version_info .major == 2 :
123
+ t = t .encode (locale .getpreferredencoding ())
121
124
testDir = os .path .join (self .TMP_DIR , t )
122
125
123
126
# copy from testdata
@@ -137,7 +140,7 @@ def testPluginPath(self):
137
140
testFile = "plugin_started.txt" ,
138
141
timeOut = 270 ,
139
142
loadPlugins = True ,
140
- env = {'QGIS_PLUGINPATH' : testDir . encode ( 'ascii' , 'ignore' ) })
143
+ env = {'QGIS_PLUGINPATH' : testDir })
141
144
142
145
def testPyQgisStartupEnvVar (self ):
143
146
# verify PYQGIS_STARTUP env variable file is run by embedded interpreter
You can’t perform that action at this time.
0 commit comments