ostree: Run commands in universal_newlines mode

This will mean the output is returned as unicode (decoded as UTF-8).
Thus Kobo will not have to do any decoding. This should work around
possible errors with breaking multibyte unicode character sequences into
different chunks.

Relates: https://pagure.io/releng/failed-composes/issue/237
Relates: https://github.com/release-engineering/kobo/issues/119
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2019-10-02 14:44:26 +02:00
parent 21d45eb243
commit f822ee324a
2 changed files with 12 additions and 3 deletions

View File

@ -48,13 +48,20 @@ class Tree(OSTree):
cmd.append('--force-nocache')
cmd.append(self.treefile)
shortcuts.run(cmd, show_cmd=True, stdout=True, logfile=log_file)
shortcuts.run(
cmd, show_cmd=True, stdout=True, logfile=log_file, universal_newlines=True
)
def _update_summary(self):
"""Update summary metadata"""
log_file = make_log_file(self.logdir, 'ostree-summary')
shortcuts.run(['ostree', 'summary', '-u', '--repo=%s' % self.repo],
show_cmd=True, stdout=True, logfile=log_file)
shortcuts.run(
['ostree', 'summary', '-u', '--repo=%s' % self.repo],
show_cmd=True,
stdout=True,
logfile=log_file,
universal_newlines=True,
)
def _update_ref(self):
"""

View File

@ -54,6 +54,7 @@ class OstreeTreeScriptTest(helpers.PungiTestCase):
logfile=self.topdir + "/logs/Atomic/create-ostree-repo.log",
show_cmd=True,
stdout=True,
universal_newlines=True,
)
] + extra_calls
)
@ -113,6 +114,7 @@ class OstreeTreeScriptTest(helpers.PungiTestCase):
logfile=self.topdir + "/logs/Atomic/ostree-summary.log",
show_cmd=True,
stdout=True,
universal_newlines=True,
)
]
)