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

@ -27,7 +27,7 @@ VERSION_FILENAME = os.path.join(
"version.py",
)
PACKAGE_INFO = {}
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
setuptools.setup(

View File

@ -21,7 +21,7 @@ VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "exporter", "datadog", "version.py"
)
PACKAGE_INFO = {}
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
setuptools.setup(version=PACKAGE_INFO["__version__"])

View File

@ -46,7 +46,7 @@ VERSION_FILENAME = os.path.join(
"aiohttp_client",
"version.py",
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
@ -57,7 +57,7 @@ PACKAGE_FILENAME = os.path.join(
"aiohttp_client",
"package.py",
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "aiopg", "version.py"
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "aiopg", "package.py"
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "asgi", "version.py"
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "asgi", "package.py"
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -46,7 +46,7 @@ VERSION_FILENAME = os.path.join(
"asyncpg",
"version.py",
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
@ -57,7 +57,7 @@ PACKAGE_FILENAME = os.path.join(
"asyncpg",
"package.py",
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "boto", "version.py"
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "boto", "package.py"
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -46,7 +46,7 @@ VERSION_FILENAME = os.path.join(
"botocore",
"version.py",
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
@ -57,7 +57,7 @@ PACKAGE_FILENAME = os.path.join(
"botocore",
"package.py",
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "celery", "version.py"
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "celery", "package.py"
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "dbapi", "version.py"
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "dbapi", "package.py"
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "django", "version.py"
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "django", "package.py"
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -46,7 +46,7 @@ VERSION_FILENAME = os.path.join(
"elasticsearch",
"version.py",
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
@ -57,7 +57,7 @@ PACKAGE_FILENAME = os.path.join(
"elasticsearch",
"package.py",
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "falcon", "version.py"
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "falcon", "package.py"
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -46,7 +46,7 @@ VERSION_FILENAME = os.path.join(
"fastapi",
"version.py",
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
@ -57,7 +57,7 @@ PACKAGE_FILENAME = os.path.join(
"fastapi",
"package.py",
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "flask", "version.py"
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "flask", "package.py"
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "grpc", "version.py"
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "grpc", "package.py"
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "httpx", "version.py"
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "httpx", "package.py"
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "jinja2", "version.py"
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "jinja2", "package.py"
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -46,7 +46,7 @@ VERSION_FILENAME = os.path.join(
"logging",
"version.py",
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
@ -57,7 +57,7 @@ PACKAGE_FILENAME = os.path.join(
"logging",
"package.py",
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "mysql", "version.py"
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "mysql", "package.py"
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -46,7 +46,7 @@ VERSION_FILENAME = os.path.join(
"psycopg2",
"version.py",
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
@ -57,7 +57,7 @@ PACKAGE_FILENAME = os.path.join(
"psycopg2",
"package.py",
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -46,7 +46,7 @@ VERSION_FILENAME = os.path.join(
"pymemcache",
"version.py",
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
@ -57,7 +57,7 @@ PACKAGE_FILENAME = os.path.join(
"pymemcache",
"package.py",
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -46,7 +46,7 @@ VERSION_FILENAME = os.path.join(
"pymongo",
"version.py",
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
@ -57,7 +57,7 @@ PACKAGE_FILENAME = os.path.join(
"pymongo",
"package.py",
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -46,7 +46,7 @@ VERSION_FILENAME = os.path.join(
"pymysql",
"version.py",
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
@ -57,7 +57,7 @@ PACKAGE_FILENAME = os.path.join(
"pymysql",
"package.py",
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -46,7 +46,7 @@ VERSION_FILENAME = os.path.join(
"pyramid",
"version.py",
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
@ -57,7 +57,7 @@ PACKAGE_FILENAME = os.path.join(
"pyramid",
"package.py",
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "redis", "version.py"
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "redis", "package.py"
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -46,7 +46,7 @@ VERSION_FILENAME = os.path.join(
"requests",
"version.py",
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
@ -57,7 +57,7 @@ PACKAGE_FILENAME = os.path.join(
"requests",
"package.py",
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -46,7 +46,7 @@ VERSION_FILENAME = os.path.join(
"sklearn",
"version.py",
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
@ -57,7 +57,7 @@ PACKAGE_FILENAME = os.path.join(
"sklearn",
"package.py",
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -46,7 +46,7 @@ VERSION_FILENAME = os.path.join(
"sqlalchemy",
"version.py",
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
@ -57,7 +57,7 @@ PACKAGE_FILENAME = os.path.join(
"sqlalchemy",
"package.py",
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -46,7 +46,7 @@ VERSION_FILENAME = os.path.join(
"sqlite3",
"version.py",
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
@ -57,7 +57,7 @@ PACKAGE_FILENAME = os.path.join(
"sqlite3",
"package.py",
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -46,7 +46,7 @@ VERSION_FILENAME = os.path.join(
"starlette",
"version.py",
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
@ -57,7 +57,7 @@ PACKAGE_FILENAME = os.path.join(
"starlette",
"package.py",
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -46,7 +46,7 @@ VERSION_FILENAME = os.path.join(
"tornado",
"version.py",
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
@ -57,7 +57,7 @@ PACKAGE_FILENAME = os.path.join(
"tornado",
"package.py",
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "urllib", "version.py"
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "urllib", "package.py"
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -46,7 +46,7 @@ VERSION_FILENAME = os.path.join(
"urllib3",
"version.py",
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
@ -57,7 +57,7 @@ PACKAGE_FILENAME = os.path.join(
"urllib3",
"package.py",
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "wsgi", "version.py"
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "wsgi", "package.py"
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -21,7 +21,7 @@ VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "propagators", "ot_trace", "version.py"
)
PACKAGE_INFO = {}
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
setuptools.setup(version=PACKAGE_INFO["__version__"])

View File

@ -8,7 +8,7 @@ import readme_renderer.rst
def is_valid_rst(path):
"""Checks if RST can be rendered on PyPI."""
with open(path) as readme_file:
with open(path, encoding="utf-8") as readme_file:
markup = readme_file.read()
return readme_renderer.rst.render(markup, stream=sys.stderr) is not None

View File

@ -546,13 +546,13 @@ def lint_args(args):
def update_changelog(path, version, new_entry):
unreleased_changes = False
try:
with open(path) as changelog:
with open(path, encoding="utf-8") as changelog:
text = changelog.read()
if "## [{}]".format(version) in text:
raise AttributeError(
"{} already contans version {}".format(path, version)
)
with open(path) as changelog:
with open(path, encoding="utf-8") as changelog:
for line in changelog:
if line.startswith("## [Unreleased]"):
unreleased_changes = False
@ -568,7 +568,7 @@ def update_changelog(path, version, new_entry):
if unreleased_changes:
print("updating: {}".format(path))
text = re.sub(r"## \[Unreleased\].*", new_entry, text)
with open(path, "w") as changelog:
with open(path, "w", encoding="utf-8") as changelog:
changelog.write(text)
@ -651,14 +651,14 @@ def update_files(targets, filename, search, replace):
print("file missing: {}/{}".format(target, filename))
continue
with open(curr_file) as _file:
with open(curr_file, encoding="utf-8") as _file:
text = _file.read()
if replace in text:
print("{} already contains {}".format(curr_file, replace))
continue
with open(curr_file, "w") as _file:
with open(curr_file, "w", encoding="utf-8") as _file:
_file.write(re.sub(search, replace, text))
if errors:

View File

@ -85,12 +85,12 @@ def main():
source = astor.to_source(tree)
with open(
os.path.join(scripts_path, "license_header.txt"), "r"
os.path.join(scripts_path, "license_header.txt"), "r", encoding="utf-8"
) as header_file:
header = header_file.read()
source = _template.format(header=header, source=source)
with open(gen_path, "w") as gen_file:
with open(gen_path, "w", encoding="utf-8") as gen_file:
gen_file.write(source)
subprocess.run(

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()

View File

@ -20,7 +20,7 @@ VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "sdk", "extension", "aws", "version.py"
)
PACKAGE_INFO = {}
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
setuptools.setup(version=PACKAGE_INFO["__version__"])

View File

@ -42,7 +42,7 @@ class AwsBeanstalkResourceDetector(ResourceDetector):
conf_file_path = "/var/elasticbeanstalk/xray/environment.conf"
try:
with open(conf_file_path) as conf_file:
with open(conf_file_path, encoding="utf-8") as conf_file:
parsed_data = json.load(conf_file)
return Resource(

View File

@ -40,13 +40,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "{{ name }}", "version.py"
)
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "{{ name }}", "package.py"
)
with open(PACKAGE_FILENAME) as f:
with open(PACKAGE_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -20,7 +20,7 @@ VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "util", "http", "version.py"
)
PACKAGE_INFO = {}
with open(VERSION_FILENAME) as f:
with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO)
setuptools.setup(version=PACKAGE_INFO["__version__"])