Bug 844509 - Always encode config.status as utf-8. r=nalexander
Now that there is no bytes strings in it, we don't need to store config.status in the system encoding to keep those valid. Moreover, the system encoding is lossy, which utf-8 is not. Differential Revision: https://phabricator.services.mozilla.com/D42731
This commit is contained in:
@@ -24,7 +24,6 @@ from mozbuild.pythonutil import iter_modules_in_path
|
||||
from mozbuild.backend.configenvironment import PartialConfigEnvironment
|
||||
from mozbuild.util import (
|
||||
indented_repr,
|
||||
system_encoding,
|
||||
)
|
||||
import mozpack.path as mozpath
|
||||
import six
|
||||
@@ -102,12 +101,12 @@ def config_status(config):
|
||||
# here, when we're able to skip configure tests/use cached results/not rely
|
||||
# on autoconf.
|
||||
logging.getLogger('moz.configure').info('Creating config.status')
|
||||
with codecs.open('config.status', 'w', system_encoding) as fh:
|
||||
with codecs.open('config.status', 'w', 'utf-8') as fh:
|
||||
fh.write(textwrap.dedent('''\
|
||||
#!%(python)s
|
||||
# coding=%(encoding)s
|
||||
# coding=utf-8
|
||||
from __future__ import unicode_literals
|
||||
''') % {'python': config['PYTHON'], 'encoding': system_encoding})
|
||||
''') % {'python': config['PYTHON']})
|
||||
for k, v in six.iteritems(sanitized_config):
|
||||
fh.write('%s = %s\n' % (k, indented_repr(v)))
|
||||
fh.write("__all__ = ['topobjdir', 'topsrcdir', 'defines', "
|
||||
|
||||
Reference in New Issue
Block a user