@@ -63,7 +63,7 @@ def debug_nginx(self):
6363 debug_address = ['0.0.0.0/0' ]
6464 for ip_addr in debug_address :
6565 if not ("debug_connection " + ip_addr in open ('/etc/nginx/'
66- 'nginx.conf' ).read ()):
66+ 'nginx.conf' , encoding = 'utf-8' ).read ()):
6767 Log .info (self , "Setting up Nginx debug connection"
6868 " for " + ip_addr )
6969 EEShellExec .cmd_exec (self , "sed -i \" /events {{/a\\ \\ \\ "
@@ -79,7 +79,8 @@ def debug_nginx(self):
7979
8080 # stop global debug
8181 elif not self .start and not self .app .pargs .site_name :
82- if "debug_connection " in open ('/etc/nginx/nginx.conf' ).read ():
82+ if "debug_connection " in open ('/etc/nginx/nginx.conf' ,
83+ encoding = 'utf-8' ).read ():
8384 Log .info (self , "Disabling Nginx debug connections" )
8485 EEShellExec .cmd_exec (self , "sed -i \" /debug_connection.*/d\" "
8586 " /etc/nginx/nginx.conf" )
@@ -146,7 +147,8 @@ def debug_php(self):
146147 data = dict (php = "9001" , debug = "9001" )
147148 Log .info (self , 'Writting the Nginx debug configration to file '
148149 '/etc/nginx/conf.d/upstream.conf ' )
149- ee_nginx = open ('/etc/nginx/conf.d/upstream.conf' , 'w' )
150+ ee_nginx = open ('/etc/nginx/conf.d/upstream.conf' ,
151+ encoding = 'utf-8' , mode = 'w' )
150152 self .app .render ((data ), 'upstream.mustache' , out = ee_nginx )
151153 ee_nginx .close ()
152154 self .trigger_php = True
@@ -165,7 +167,8 @@ def debug_php(self):
165167 data = dict (php = "9000" , debug = "9001" )
166168 Log .debug (self , 'Writting the Nginx debug configration to file'
167169 ' /etc/nginx/conf.d/upstream.conf ' )
168- ee_nginx = open ('/etc/nginx/conf.d/upstream.conf' , 'w' )
170+ ee_nginx = open ('/etc/nginx/conf.d/upstream.conf' ,
171+ encoding = 'utf-8' , mode = 'w' )
169172 self .app .render ((data ), 'upstream.mustache' , out = ee_nginx )
170173 ee_nginx .close ()
171174 self .trigger_php = True
@@ -186,7 +189,8 @@ def debug_fpm(self):
186189 config .remove_option ('global' , 'include' )
187190 config ['global' ]['log_level' ] = 'debug'
188191 config ['global' ]['include' ] = '/etc/php5/fpm/pool.d/*.conf'
189- with open ('/etc/php5/fpm/php-fpm.conf' , 'w' ) as configfile :
192+ with open ('/etc/php5/fpm/php-fpm.conf' ,
193+ encoding = 'utf-8' , mode = 'w' ) as configfile :
190194 Log .debug (self , "Writting php5-FPM configuration into "
191195 "/etc/php5/fpm/php-fpm.conf" )
192196 config .write (configfile )
@@ -206,7 +210,8 @@ def debug_fpm(self):
206210 config .remove_option ('global' , 'include' )
207211 config ['global' ]['log_level' ] = 'notice'
208212 config ['global' ]['include' ] = '/etc/php5/fpm/pool.d/*.conf'
209- with open ('/etc/php5/fpm/php-fpm.conf' , 'w' ) as configfile :
213+ with open ('/etc/php5/fpm/php-fpm.conf' ,
214+ encoding = 'utf-8' , mode = 'w' ) as configfile :
210215 Log .debug (self , "writting php5 configuration into "
211216 "/etc/php5/fpm/php-fpm.conf" )
212217 config .write (configfile )
@@ -278,7 +283,7 @@ def debug_wp(self):
278283 " grep true" .format (wp_config )):
279284 Log .info (self , "Starting WordPress debug" )
280285 open ("{0}/htdocs/wp-content/debug.log" .format (webroot ),
281- 'a' ).close ()
286+ encoding = 'utf-8' , mode = 'a' ).close ()
282287 EEShellExec .cmd_exec (self , "chown {1}: {0}/htdocs/wp-"
283288 "content/debug.log"
284289 "" .format (webroot ,
0 commit comments