From 3557f0c6d0c6e01c9a7e3d8d60bb6bf30607fee4 Mon Sep 17 00:00:00 2001 From: konstin Date: Mon, 9 May 2022 21:39:18 +0200 Subject: [PATCH] windows, next try --- .../check_installed/check_installed.py | 45 +++++++++---------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/test-crates/with-data/check_installed/check_installed.py b/test-crates/with-data/check_installed/check_installed.py index 7975592f8..23cfd5282 100644 --- a/test-crates/with-data/check_installed/check_installed.py +++ b/test-crates/with-data/check_installed/check_installed.py @@ -9,28 +9,25 @@ venv_root = Path(sys.prefix) -try: - installed_data = ( - venv_root.joinpath("data_subdir").joinpath("hello.txt").read_text().strip() - ) - assert installed_data == "Hi! 😊", ( - installed_data, - "Hi! 😊", - locale.getpreferredencoding(), - ) - header_file = ( - venv_root.joinpath("include") - .joinpath("site") - .joinpath(f"python{sys.version_info.major}.{sys.version_info.minor}") - .joinpath("with-data") - .joinpath("empty.h") - ) - assert header_file.is_file(), header_file -except (AssertionError, FileNotFoundError): - print("__file__", __file__) - print("venv_root", venv_root) - # Debugging help - for i in sorted(venv_root.glob("**/*")): - print(i) - raise +installed_data = ( + venv_root.joinpath("data_subdir") + .joinpath("hello.txt") + # With the default encoding, python under windows fails to read the file correctly :/ + .read_text(encoding="utf-8") + .strip() +) +assert installed_data == "Hi! 😊", ( + installed_data, + "Hi! 😊", + locale.getpreferredencoding(), +) +header_file = ( + venv_root.joinpath("include") + .joinpath("site") + .joinpath(f"python{sys.version_info.major}.{sys.version_info.minor}") + .joinpath("with-data") + .joinpath("empty.h") +) +assert header_file.is_file(), header_file + print("SUCCESS")