mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 15:35:46 +07:00
[FIX] runbot_cla: fix enforce utf-8 even when runbot locale is different
The CLA md file must be encoded in UTF-8 but before this commit, the file was opened with the locale of the system running the runbot. That way, a UnicodeDecodeError was raised when the CLA was UTF-8 and not the runbot locale was different. Leading to wrong validations. This commit enforce UTF-8 encoding when opening the CLA's.
This commit is contained in:
parent
9ff0e171e0
commit
f5dcb7b371
@ -1,6 +1,7 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
|
||||
import glob
|
||||
import io
|
||||
import logging
|
||||
import re
|
||||
|
||||
@ -24,7 +25,7 @@ class runbot_build(models.Model):
|
||||
state = "success"
|
||||
else:
|
||||
try:
|
||||
cla = ''.join(open(f).read() for f in cla_glob)
|
||||
cla = ''.join(io.open(f,encoding='utf-8').read() for f in cla_glob)
|
||||
if cla.lower().find(email) != -1:
|
||||
state = "success"
|
||||
except UnicodeDecodeError:
|
||||
|
Loading…
Reference in New Issue
Block a user