fix: open setup.py as utf-8 in get_requires_python_str (#977)

* open setup.py as utf-8 in get_requires_python_str

fix #976

* update test for UTF-8 setup.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: mayeut <mayeut@users.noreply.github.com>
This commit is contained in:
Forest Gregg
2021-12-30 10:14:16 +01:00
committed by GitHub
co-authored by pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> mayeut
parent d6bede539d
commit e9ef3e9750
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ def get_requires_python_str(package_dir: Path) -> Optional[str]:
pass
try:
with (package_dir / "setup.py").open() as f2:
with (package_dir / "setup.py").open(encoding="utf8") as f2:
return setup_py_python_requires(f2.read())
except FileNotFoundError:
pass