update open calls to pass encoding (#684)

This commit is contained in:
alrex
2021-09-22 10:16:14 -07:00
committed by GitHub
parent 1cf5021bb6
commit 354bdc42d9
44 changed files with 86 additions and 84 deletions

View File

@ -36,7 +36,9 @@ _prefix = "opentelemetry-instrumentation-"
def main():
root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
with open(
os.path.join(root_path, _template_dir, _template_name), "r"
os.path.join(root_path, _template_dir, _template_name),
"r",
encoding="utf-8",
) as template:
setuppy_tmpl = Template(template.read())
base_instrumentation_path = os.path.join(root_path, "instrumentation")
@ -69,7 +71,7 @@ def main():
generated_file = os.path.join(instrumentation_path, "setup.py")
logger.info("generated %s", generated_file)
with open(generated_file, "w") as fh:
with open(generated_file, "w", encoding="utf-8") as fh:
fh.write(generated)
fh.flush()