From fbc6933aa7c314505a22ac15136958d6217f0815 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Tue, 24 Sep 2024 19:42:17 -0400 Subject: [PATCH 1/3] Update ChangeLog.md --- ChangeLog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 7d289839..5ff403ae 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -10,7 +10,7 @@ Release 5.12.0 === This release brings a number of performance enhancements and functionality updates requested by the community to EDMC. -Notably, integration with Inara's SLEF notation, custom pugin directories, streamlined logging locations, and +Notably, integration with Inara's SLEF notation, custom plugin directories, streamlined logging locations, and performance enhancements are included. This release also fixes a few administrative issues regarding licenses to ensure compliance with included libraries. From d8eed62e08ff830a0d3fd35a9f812203a8197df9 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Fri, 26 Dec 2025 11:22:31 -0500 Subject: [PATCH 2/3] [#2567] Improve TOML Dump Safety --- config/windows.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/config/windows.py b/config/windows.py index ae727c33..947a71a0 100644 --- a/config/windows.py +++ b/config/windows.py @@ -9,6 +9,7 @@ from __future__ import annotations import pathlib import sys +import os import uuid import winreg import datetime @@ -88,9 +89,25 @@ class WinConfigMinimal: path_obj = pathlib.Path(toml_path) path_obj.parent.mkdir(parents=True, exist_ok=True) + tmp_path = path_obj.with_suffix(path_obj.suffix + ".tmp") config_logger.debug("Writing Config File") - with path_obj.open("wb") as f: - tomli_w.dump(config_data, f) + try: + # Validate serialization BEFORE touching the real file + tomli_w.dumps(config_data) + with tmp_path.open("wb") as f: + tomli_w.dump(config_data, f) + f.flush() + os.fsync(f.fileno()) + tmp_path.replace(path_obj) + except Exception: + config_logger.exception("Failed to write TOML config file") + # Ensure temp file doesn't linger + try: + if tmp_path.exists(): + tmp_path.unlink() + except Exception: + pass + raise def close(self): """Close registry handle.""" From e1d64c95c605462e8a6726686eba9632f88c932a Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Fri, 26 Dec 2025 11:58:10 -0500 Subject: [PATCH 3/3] [RELEASE] 6.0.2 --- ChangeLog.md | 7 +++++++ config/__init__.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index b6b80e66..3cd3cfba 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -2,6 +2,13 @@ This is the master changelog for Elite Dangerous Market Connector. Entries are --- * We currently test against, and package with, Python 3.13, 64-bit. --- +Release 6.0.2 +=== +This release adds additional safety checks for the writing of the new config file on first write for Windows installs. + +**Bug Fixes** +* Fixes a bug where the new config.toml file could be improperly written with all null content. + Release 6.0.1 === This release fixes a bug with 6.0.0 for Caspian Explorer pilots due to a typo and clarifies the license in use with EDMC. diff --git a/config/__init__.py b/config/__init__.py index d859c8f3..9f937f87 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -54,7 +54,7 @@ appcmdname = "EDMC" # # Major.Minor.Patch(-prerelease)(+buildmetadata) # NB: Do *not* import this, use the functions appversion() and appversion_nobuild() -_static_appversion = "6.0.1" +_static_appversion = "6.0.2" _cached_version: semantic_version.Version | None = None copyright = "© 2015-2019 Jonathan Harris, 2020-2025 EDCD"