From 2ccf30c72e7e16c95f3c8c0cd2aa216ab097c1eb Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Thu, 12 Dec 2024 14:13:15 +0800 Subject: [PATCH] TO BE REVERTED: test leaving out encoding --- src/pymatgen/util/io_utils.py | 2 +- tests/io/pwmat/test_inputs.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pymatgen/util/io_utils.py b/src/pymatgen/util/io_utils.py index 7bf4efdc2f4..f8c7d268f43 100644 --- a/src/pymatgen/util/io_utils.py +++ b/src/pymatgen/util/io_utils.py @@ -81,7 +81,7 @@ def micro_pyawk(filename, search, results=None, debug=None, postdebug=None): for entry in search: entry[0] = re.compile(entry[0]) - with zopen(filename, mode="rt", encoding="utf-8") as file: + with zopen(filename, mode="rt") as file: for line in file: for entry in search: match = re.search(entry[0], line) diff --git a/tests/io/pwmat/test_inputs.py b/tests/io/pwmat/test_inputs.py index e1438482623..2f2cd60ac93 100644 --- a/tests/io/pwmat/test_inputs.py +++ b/tests/io/pwmat/test_inputs.py @@ -47,7 +47,7 @@ class TestACstrExtractor(PymatgenTest): def test_extract(self): filepath = f"{TEST_DIR}/atom.config" ac_extractor = ACExtractor(file_path=filepath) - with zopen(filepath, mode="rt", encoding="utf-8") as file: + with zopen(filepath, mode="rt") as file: ac_str_extractor = ACstrExtractor(atom_config_str="".join(file.readlines())) assert ac_extractor.n_atoms == ac_str_extractor.get_n_atoms() for idx in range(9):