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", "version.py",
) )
PACKAGE_INFO = {} PACKAGE_INFO = {}
with open(VERSION_FILENAME) as f: with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO) exec(f.read(), PACKAGE_INFO)
setuptools.setup( setuptools.setup(

View File

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

View File

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

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join( VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "aiopg", "version.py" 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) exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join( PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "aiopg", "package.py" 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) exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well. # Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join( VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "asgi", "version.py" 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) exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join( PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "asgi", "package.py" 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) exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well. # Mark any instruments/runtime dependencies as test dependencies as well.

View File

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

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join( VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "boto", "version.py" 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) exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join( PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "boto", "package.py" 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) exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well. # Mark any instruments/runtime dependencies as test dependencies as well.

View File

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

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join( VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "celery", "version.py" 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) exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join( PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "celery", "package.py" 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) exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well. # Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join( VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "dbapi", "version.py" 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) exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join( PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "dbapi", "package.py" 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) exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well. # Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join( VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "django", "version.py" 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) exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join( PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "django", "package.py" 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) exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well. # Mark any instruments/runtime dependencies as test dependencies as well.

View File

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

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join( VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "falcon", "version.py" 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) exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join( PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "falcon", "package.py" 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) exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well. # Mark any instruments/runtime dependencies as test dependencies as well.

View File

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

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join( VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "flask", "version.py" 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) exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join( PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "flask", "package.py" 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) exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well. # Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join( VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "grpc", "version.py" 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) exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join( PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "grpc", "package.py" 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) exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well. # Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join( VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "httpx", "version.py" 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) exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join( PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "httpx", "package.py" 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) exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well. # Mark any instruments/runtime dependencies as test dependencies as well.

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join( VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "jinja2", "version.py" 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) exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join( PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "jinja2", "package.py" 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) exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well. # Mark any instruments/runtime dependencies as test dependencies as well.

View File

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

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join( VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "mysql", "version.py" 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) exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join( PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "mysql", "package.py" 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) exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well. # Mark any instruments/runtime dependencies as test dependencies as well.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join( VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "redis", "version.py" 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) exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join( PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "redis", "package.py" 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) exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well. # Mark any instruments/runtime dependencies as test dependencies as well.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join( VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "urllib", "version.py" 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) exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join( PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "urllib", "package.py" 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) exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well. # Mark any instruments/runtime dependencies as test dependencies as well.

View File

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

View File

@ -41,13 +41,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join( VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "wsgi", "version.py" 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) exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join( PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "wsgi", "package.py" 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) exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well. # 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" BASE_DIR, "src", "opentelemetry", "propagators", "ot_trace", "version.py"
) )
PACKAGE_INFO = {} PACKAGE_INFO = {}
with open(VERSION_FILENAME) as f: with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO) exec(f.read(), PACKAGE_INFO)
setuptools.setup(version=PACKAGE_INFO["__version__"]) setuptools.setup(version=PACKAGE_INFO["__version__"])

View File

@ -8,7 +8,7 @@ import readme_renderer.rst
def is_valid_rst(path): def is_valid_rst(path):
"""Checks if RST can be rendered on PyPI.""" """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() markup = readme_file.read()
return readme_renderer.rst.render(markup, stream=sys.stderr) is not None 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): def update_changelog(path, version, new_entry):
unreleased_changes = False unreleased_changes = False
try: try:
with open(path) as changelog: with open(path, encoding="utf-8") as changelog:
text = changelog.read() text = changelog.read()
if "## [{}]".format(version) in text: if "## [{}]".format(version) in text:
raise AttributeError( raise AttributeError(
"{} already contans version {}".format(path, version) "{} already contans version {}".format(path, version)
) )
with open(path) as changelog: with open(path, encoding="utf-8") as changelog:
for line in changelog: for line in changelog:
if line.startswith("## [Unreleased]"): if line.startswith("## [Unreleased]"):
unreleased_changes = False unreleased_changes = False
@ -568,7 +568,7 @@ def update_changelog(path, version, new_entry):
if unreleased_changes: if unreleased_changes:
print("updating: {}".format(path)) print("updating: {}".format(path))
text = re.sub(r"## \[Unreleased\].*", new_entry, text) 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) changelog.write(text)
@ -651,14 +651,14 @@ def update_files(targets, filename, search, replace):
print("file missing: {}/{}".format(target, filename)) print("file missing: {}/{}".format(target, filename))
continue continue
with open(curr_file) as _file: with open(curr_file, encoding="utf-8") as _file:
text = _file.read() text = _file.read()
if replace in text: if replace in text:
print("{} already contains {}".format(curr_file, replace)) print("{} already contains {}".format(curr_file, replace))
continue 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)) _file.write(re.sub(search, replace, text))
if errors: if errors:

View File

@ -85,12 +85,12 @@ def main():
source = astor.to_source(tree) source = astor.to_source(tree)
with open( 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: ) as header_file:
header = header_file.read() header = header_file.read()
source = _template.format(header=header, source=source) 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) gen_file.write(source)
subprocess.run( subprocess.run(

View File

@ -36,7 +36,9 @@ _prefix = "opentelemetry-instrumentation-"
def main(): def main():
root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
with open( 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: ) as template:
setuppy_tmpl = Template(template.read()) setuppy_tmpl = Template(template.read())
base_instrumentation_path = os.path.join(root_path, "instrumentation") base_instrumentation_path = os.path.join(root_path, "instrumentation")
@ -69,7 +71,7 @@ def main():
generated_file = os.path.join(instrumentation_path, "setup.py") generated_file = os.path.join(instrumentation_path, "setup.py")
logger.info("generated %s", generated_file) 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.write(generated)
fh.flush() fh.flush()

View File

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

View File

@ -42,7 +42,7 @@ class AwsBeanstalkResourceDetector(ResourceDetector):
conf_file_path = "/var/elasticbeanstalk/xray/environment.conf" conf_file_path = "/var/elasticbeanstalk/xray/environment.conf"
try: 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) parsed_data = json.load(conf_file)
return Resource( return Resource(

View File

@ -40,13 +40,13 @@ PACKAGE_INFO = {}
VERSION_FILENAME = os.path.join( VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "{{ name }}", "version.py" 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) exec(f.read(), PACKAGE_INFO)
PACKAGE_FILENAME = os.path.join( PACKAGE_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "instrumentation", "{{ name }}", "package.py" 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) exec(f.read(), PACKAGE_INFO)
# Mark any instruments/runtime dependencies as test dependencies as well. # 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" BASE_DIR, "src", "opentelemetry", "util", "http", "version.py"
) )
PACKAGE_INFO = {} PACKAGE_INFO = {}
with open(VERSION_FILENAME) as f: with open(VERSION_FILENAME, encoding="utf-8") as f:
exec(f.read(), PACKAGE_INFO) exec(f.read(), PACKAGE_INFO)
setuptools.setup(version=PACKAGE_INFO["__version__"]) setuptools.setup(version=PACKAGE_INFO["__version__"])