File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 28
28
from PyQt4 .QtNetwork import *
29
29
import sys
30
30
import os
31
+ import codecs
31
32
import ConfigParser
32
33
import qgis .utils
33
34
from qgis .core import *
@@ -556,12 +557,10 @@ def pluginMetadata(fct):
556
557
if not os .path .exists (metadataFile ):
557
558
return "" # plugin has no metadata.txt file
558
559
cp = ConfigParser .ConfigParser ()
559
- res = cp .read (metadataFile )
560
- if not len (res ):
561
- return "" # failed reading metadata.txt file
562
560
try :
561
+ cp .readfp (codecs .open (metadataFile , "r" , "utf8" ))
563
562
return cp .get ('general' , fct )
564
- except Exception :
563
+ except :
565
564
return ""
566
565
567
566
if readOnly :
Original file line number Diff line number Diff line change 38
38
import re
39
39
import ConfigParser
40
40
import warnings
41
+ import codecs
41
42
42
43
#######################
43
44
# ERROR HANDLING
@@ -129,8 +130,10 @@ def findPlugins(path):
129
130
continue
130
131
131
132
cp = ConfigParser .ConfigParser ()
132
- res = cp .read (metadataFile )
133
- if len (res ) == 0 :
133
+
134
+ try :
135
+ cp .readfp (codecs .open (metadataFile , "r" , "utf8" ))
136
+ except :
134
137
return None # reading of metadata file failed
135
138
136
139
pluginName = os .path .basename (plugin )
You can’t perform that action at this time.
0 commit comments