From 127548777d03519397a5baafd21200c381cad97b Mon Sep 17 00:00:00 2001 From: awight-watershed <148799473+awight-watershed@users.noreply.github.com> Date: Thu, 9 Apr 2026 10:55:36 -0300 Subject: [PATCH] Added explicit utf-8 encoding to two steps where html is written to file. The utf-8 encoding is required on line 635 because that HTML file has the angstrom symbol, which can't be encoded in ASCII. The change on line 583 was not strictly necessary in my tests, since that HTML file lacks any non-ASCII characters, but for consistency's sake I thought we should have both writes be in utf-8, especially if that other HTML file is ever changed in the future. --- src/unomd/main/run_html_export.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/unomd/main/run_html_export.py b/src/unomd/main/run_html_export.py index dc6c5d6..77d3314 100644 --- a/src/unomd/main/run_html_export.py +++ b/src/unomd/main/run_html_export.py @@ -580,7 +580,7 @@ def save_molecule_viewer_html(config): """ - with open(config.get("path_molviewer_html"), "w") as f: + with open(config.get("path_molviewer_html"), "w", encoding='utf-8') as f: f.write(custom_html) logger.info(f"Location: {config.get('path_molviewer_html')}") @@ -632,7 +632,7 @@ def save_rmsd_rmsf_html(config): # Save summary table summary_path = html_plot_path.replace('.html', '_summary.html') - with open(summary_path, 'w') as f: + with open(summary_path, 'w', encoding='utf-8') as f: f.write(summary_html) logger.info(f"Analysis summary table saved to: {summary_path}") @@ -675,4 +675,4 @@ def save_rmsd_rmsf_html(config): else: logger.error("No config file provided. Please provide a config file.") raise ValueError("No config file provided. Please provide a config file.") - save_rmsd_rmsf_html(config) \ No newline at end of file + save_rmsd_rmsf_html(config)