diff --git a/runbot/models/repo.py b/runbot/models/repo.py index 54e71cdf..bf9ff48f 100644 --- a/runbot/models/repo.py +++ b/runbot/models/repo.py @@ -479,8 +479,8 @@ class Repo(models.Model): git_config_path = os.path.join(repo.path, 'config') template_params = {'repo': repo} git_config = self.env['ir.ui.view']._render_template("runbot.git_config", template_params) - with open(git_config_path, 'wb') as config_file: - config_file.write(git_config) + with open(git_config_path, 'w') as config_file: + config_file.write(str(git_config)) _logger.info('Config updated for repo %s' % repo.name) else: _logger.info('Repo not cloned, skiping config update for %s' % repo.name) diff --git a/runbot/models/runbot.py b/runbot/models/runbot.py index 5a1e1649..4365477a 100644 --- a/runbot/models/runbot.py +++ b/runbot/models/runbot.py @@ -161,8 +161,8 @@ class Runbot(models.AbstractModel): content = f.read() if content != nginx_config: _logger.info('reload nginx') - with open(nginx_conf_path, 'wb') as f: - f.write(nginx_config) + with open(nginx_conf_path, 'w') as f: + f.write(str(nginx_config)) try: pid = int(open(os.path.join(nginx_dir, 'nginx.pid')).read().strip(' \n')) os.kill(pid, signal.SIGHUP)