Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sas/qtgui/Calculators/SAXSPluginModelGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def write_plugin_model(structure_path: str):

path = Path(find_plugins_dir()) / "ausaxs_saxs_plugin.py"
text = get_model_text(structure_path)
with open(path, 'w') as f:
with open(path, 'w', encoding="utf-8") as f:
f.write(text)

def get_model_text(structure_path: str) -> str:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def write_new_model_to_file(self, fname, model1_name, model2_name, operator):
operator=operator,
desc_line=desc_line)

with open(fname, 'w') as out_f:
with open(fname, 'w', encoding="utf-8") as out_f:
out_f.write(output)

def updateModels(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ def writeModel(output_file_path: str | pathlib.Path, model_text: str):
:param model_text: str of the model text to write
"""
try:
with open(output_file_path, 'w') as f:
with open(output_file_path, 'w', encoding="utf-8") as f:
f.write(model_text)
except Exception as ex:
logger.error("Error writing model to file: %s" % ex)
Expand Down