Open role readme files in utf-8 mode
I managed to get some hidden utf-8 characters into a zuul role README.rst file which broke building in the gate on python 2.7 in a rather mysterious way, deep inside the rst parser. Make sure we open the README.rst files in unicode mode; this way the lines are passed into the rst core as unicode and things go as planned. Change-Id: Id27062989c0527de545b18471eec29926955a4e4
This commit is contained in:
parent
fb48c1fe3d
commit
44012c032b
@ -13,6 +13,7 @@
|
||||
# under the License.
|
||||
|
||||
from collections import OrderedDict
|
||||
import codecs
|
||||
import os
|
||||
|
||||
from sphinx import addnodes
|
||||
@ -187,7 +188,7 @@ class ZuulDirective(Directive):
|
||||
lines.append('.. zuul:role:: %s' % name)
|
||||
lines.append('')
|
||||
role_readme = self.zuul_role_paths[name]
|
||||
with open(role_readme) as f:
|
||||
with codecs.open(role_readme, encoding='utf-8') as f:
|
||||
role_lines = f.read().split('\n')
|
||||
for l in role_lines:
|
||||
lines.append(' ' + l)
|
||||
|
Loading…
Reference in New Issue
Block a user