From 3e24678f8973db3ffcec54e099117398f2012305 Mon Sep 17 00:00:00 2001 From: Sriram Madapusi Vasudevan <3770774+TheSriram@users.noreply.github.com> Date: Wed, 10 Jul 2019 14:45:44 -0700 Subject: [PATCH] fix: encoding on files read for publish integ tests (#1264) --- tests/integration/publish/publish_app_integ_base.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/integration/publish/publish_app_integ_base.py b/tests/integration/publish/publish_app_integ_base.py index d2c689fb0d..7557b2ec2a 100644 --- a/tests/integration/publish/publish_app_integ_base.py +++ b/tests/integration/publish/publish_app_integ_base.py @@ -31,20 +31,20 @@ def setUpClass(cls): cls.s3_bucket.create() # Grant serverlessrepo read access to the bucket - bucket_policy_template = cls.test_data_path.joinpath("s3_bucket_policy.json").read_text() + bucket_policy_template = cls.test_data_path.joinpath("s3_bucket_policy.json").read_text(encoding="utf-8") bucket_policy = bucket_policy_template.replace(cls.bucket_name_placeholder, cls.bucket_name) cls.s3_bucket.Policy().put(Policy=bucket_policy) # Upload test files to S3 root_path = Path(__file__).resolve().parents[3] - license_body = root_path.joinpath("LICENSE").read_text() + license_body = root_path.joinpath("LICENSE").read_text(encoding="utf-8") cls.s3_bucket.put_object(Key="LICENSE", Body=license_body) - readme_body = root_path.joinpath("README.md").read_text() + readme_body = root_path.joinpath("README.md").read_text(encoding="utf-8") cls.s3_bucket.put_object(Key="README.md", Body=readme_body) cls.s3_bucket.put_object(Key="README_UPDATE.md", Body=readme_body) - code_body = cls.test_data_path.joinpath("main.py").read_text() + code_body = cls.test_data_path.joinpath("main.py").read_text(encoding="utf-8") cls.s3_bucket.put_object(Key="main.py", Body=code_body) @classmethod @@ -61,7 +61,7 @@ def tearDownClass(cls): def replace_template_placeholder(cls, placeholder, replace_text): for f in cls.temp_dir.iterdir(): if f.suffix == ".yaml" or f.suffix == ".json": - content = f.read_text() + content = f.read_text(encoding="utf-8") f.write_text(content.replace(placeholder, replace_text)) def setUp(self):