Skip to content

Commit 3fe02e2

Browse files
Update charmm_containers.py (#11)
fixed file reading for windows (from @avanteijlingen)
1 parent 6cdfa32 commit 3fe02e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pygen_structures/charmm_containers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ def read_file(
828828
and ``last`` if True.
829829
830830
"""
831-
with open(rtf_path, encoding="utf-8") as rtf_file:
831+
with open(rtf_path, "r", encoding="utf-8") as rtf_file:
832832
contents = rtf_file.read()
833833
if os.path.splitext(rtf_path)[-1] == ".str":
834834
try:
@@ -941,7 +941,7 @@ def read_file(self, prm_path: str) -> None:
941941
:param prm_path: path to .prm/.str file
942942
943943
"""
944-
with open(prm_path, encoding="utf-8") as prm_file:
944+
with open(prm_path, "r", encoding="utf-8") as prm_file:
945945
contents = prm_file.read()
946946
if os.path.splitext(prm_path)[-1] == ".str":
947947
try:

0 commit comments

Comments
 (0)