Commit 1ea41422 authored by Florian Fischer's avatar Florian Fischer
Browse files

make open encoding explicit

parent d87426c8
Pipeline #76028 failed with stage
in 15 seconds
......@@ -186,8 +186,8 @@ class Client(subprocess.Popen):
'err': err_file,
'host': host
}))
self.fout = open(out_file, 'w')
self.ferr = open(err_file, 'w')
self.fout = open(out_file, 'w', encoding='utf-8')
self.ferr = open(err_file, 'w', encoding='utf-8')
super().__init__(cmd.split(),
stdout=self.fout,
......
......@@ -16,15 +16,13 @@ class Coordinator(subprocess.Popen):
self.fout = subprocess.DEVNULL
self.ferr = subprocess.DEVNULL
if out_file:
self.fout = open(out_file, 'w')
self.fout = open(out_file, 'w', encoding='utf-8')
if err_file:
self.ferr = open(err_file, 'w')
self.ferr = open(err_file, 'w', encoding='utf-8')
cmd = f'{COORDINATOR_EXE} {nclients}'
log.debug('Creating coordinator object with cmd: %s', cmd)
super().__init__(cmd.split(),
stdout=self.fout,
stderr=self.ferr)
super().__init__(cmd.split(), stdout=self.fout, stderr=self.ferr)
def __enter__(self):
log.debug('Start coordinator')
......
......@@ -389,7 +389,7 @@ def prepare_client(data_dir: Path):
"""Prepare and build the special emper variant for the client"""
client_checkout = get_commit_id(REPO, CLIENT_CHECKOUT)
with open(data_dir / 'desc.yml', 'a') as desc_file:
with open(data_dir / 'desc.yml', 'a', encoding='utf-8') as desc_file:
print(f'client_commit: {client_checkout}', file=desc_file)
# print(f'client_cmd: {CLIENT_CMD}', file=desc_file)
......@@ -493,7 +493,8 @@ def prepare_flavors(data_dir: Path,
commit_ish=desc.get('checkout', DEFAULT_CHECKOUT))
meson_options = desc.get("meson_options", "")
with open(flavor_dir / 'desc.yml', 'w') as flavor_desc_file:
with open(flavor_dir / 'desc.yml', 'w',
encoding='utf-8') as flavor_desc_file:
print(f'cmd: {server_cmd}', file=flavor_desc_file)
print(f'commit: {checkout}', file=flavor_desc_file)
print(f'meson_options: {meson_options}', file=flavor_desc_file)
......
......@@ -56,8 +56,8 @@ class Server(subprocess.Popen):
'host': host or 'localhost'
}))
self.fout = open(out_file, 'w')
self.ferr = open(err_file, 'w')
self.fout = open(out_file, 'w', encoding='utf-8')
self.ferr = open(err_file, 'w', encoding='utf-8')
server_env = prepare_env(env or {})
......
......@@ -45,7 +45,7 @@ CLIENT_SEPARATION_TIME = 10
def write_desc(data_dir):
"""Write a YAML description of the evaluation into result_dir"""
desc_file_path = data_dir / 'desc.yml'
with open(desc_file_path, 'w') as desc_file:
with open(desc_file_path, 'w', encoding='utf-8') as desc_file:
print(f'start: {start_time.isoformat()}', file=desc_file)
print(f'args: {ARGS}', file=desc_file)
print(f'host: {HOST}', file=desc_file)
......@@ -92,7 +92,7 @@ def summarize(results: Mapping[str, Sequence[Sequence[BenchResult]]]):
summary += f'{result.name}: {amount}\n'
print(summary)
with open(DATA_DIR / 'summary.txt', 'w') as summary_file:
with open(DATA_DIR / 'summary.txt', 'w', encoding='utf-8') as summary_file:
print(summary, file=summary_file)
......
......@@ -177,7 +177,7 @@ $table};
tikz += tail.substitute(y_label=y_label,
title=result_dir.replace('_', '\\_'))
with open(output_path, 'w') as output_file:
with open(output_path, 'w', encoding='utf-8') as output_file:
print(tikz, file=output_file)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment