5
0
mirror of https://github.com/odoo/runbot.git synced 2025-03-16 07:55:45 +07:00

[FIX] runbot_cla: avoid unicode errors when reading CLA files

This commit is contained in:
Olivier Dony 2016-02-03 15:50:07 +01:00
parent 5ef0b2ee6d
commit 0535f99616

View File

@ -5,6 +5,7 @@ import logging
import re
import openerp
from openerp.tools import ustr
_logger = logging.getLogger(__name__)
@ -15,8 +16,7 @@ class runbot_build(openerp.models.Model):
cla_glob = glob.glob(build.path("doc/cla/*/*.md"))
if cla_glob:
cla = ''.join(open(f).read() for f in cla_glob)
cla = cla.lower()
cla = cla.decode('utf-8')
cla = ustr(cla.lower())
mo = re.search('[^ <@]+@[^ @>]+', build.author_email or '')
state = "failure"
if mo: