Skip to content

Commit

Permalink
Merge pull request #396 from MilesCranmer/encoding-fix
Browse files Browse the repository at this point in the history
Ensure files are read as utf-8 on all operating systems
  • Loading branch information
MilesCranmer authored Aug 1, 2023
2 parents 3a9acd3 + 2ae253a commit 228d437
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pysr/sr.py
Original file line number Diff line number Diff line change
Expand Up @@ -2189,7 +2189,7 @@ def _read_equation_file(self):
cur_filename = str(self.equation_file_) + f".out{i}" + ".bkup"
if not os.path.exists(cur_filename):
cur_filename = str(self.equation_file_) + f".out{i}"
with open(cur_filename, "r") as f:
with open(cur_filename, "r", encoding="utf-8") as f:
buf = f.read()
buf = _preprocess_julia_floats(buf)

Expand All @@ -2200,7 +2200,7 @@ def _read_equation_file(self):
filename = str(self.equation_file_) + ".bkup"
if not os.path.exists(filename):
filename = str(self.equation_file_)
with open(filename, "r") as f:
with open(filename, "r", encoding="utf-8") as f:
buf = f.read()
buf = _preprocess_julia_floats(buf)
all_outputs = [self._postprocess_dataframe(pd.read_csv(StringIO(buf)))]
Expand Down
2 changes: 1 addition & 1 deletion pysr/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "0.15.1"
__version__ = "0.15.2"
__symbolic_regression_jl_version__ = "0.21.3"

0 comments on commit 228d437

Please sign in to comment.