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):