File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,12 +144,12 @@ def __update_setting(self, new_setting):
144144 sub_str = 'PLUGIN_PATH = ' + self .__format_setting (final_setting )
145145
146146 setting_path = self .app .config .root_path + '/config/setting.py'
147- with open (setting_path , 'r' ) as f :
147+ with open (setting_path , 'r' , encoding = 'UTF-8' ) as f :
148148 content = f .read ()
149149 pattern = 'PLUGIN_PATH = \{([\s\S]*)\}+.*?'
150150 result = re .sub (pattern , sub_str , content )
151151
152- with open (setting_path , 'w+' ) as f :
152+ with open (setting_path , 'w+' , encoding = 'UTF-8' ) as f :
153153 f .write (result )
154154
155155 def __get_all_plugins (self ):
@@ -255,7 +255,7 @@ def __generate_plugin_graph(self):
255255 '.' , '/' ).replace ('app' , '' )
256256 requirements_path = self .app .config .root_path + \
257257 plugin_path + '/requirements.txt'
258- with open (requirements_path , 'r' ) as f :
258+ with open (requirements_path , 'r' , encoding = 'UTF-8' ) as f :
259259 while True :
260260
261261 # 正则匹配requirements的每一行的信息
You can’t perform that action at this time.
0 commit comments