diff --git a/bump_pydantic/main.py b/bump_pydantic/main.py index 7f1c282..39a45ab 100644 --- a/bump_pydantic/main.py +++ b/bump_pydantic/main.py @@ -82,7 +82,7 @@ def main( progress.advance(task) # Visitor logic - code = Path(filename).read_text() + code = Path(filename).read_text(encoding="utf8") module = cst.parse_module(code) module_and_package = calculate_module_and_package(str(package), filename) @@ -109,7 +109,7 @@ def main( codemods = gather_codemods(disabled=disable) - log_fp = log_file.open("a+") + log_fp = log_file.open("a+", encoding="utf8") partial_run_codemods = functools.partial(run_codemods, codemods, metadata_manager, scratch, package, diff) with Progress(*Progress.get_default_columns(), transient=True) as progress: task = progress.add_task(description="Executing codemods...", total=len(files)) diff --git a/pyproject.toml b/pyproject.toml index 9836a1b..27cfaea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,6 +78,11 @@ target-version = 'py38' [tool.pytest.ini_options] xfail_strict = true +filterwarnings = [ + # Turn warnings that aren't filtered into exceptions + "error", + "ignore::pytest.PytestUnraisableExceptionWarning" +] [tool.coverage.run] branch = true