From 3f8922b83f90098719f0a7730bb1393be84bbdf5 Mon Sep 17 00:00:00 2001 From: QwejayHuang Date: Sat, 5 Sep 2026 23:25:00 +0800 Subject: [PATCH] v2.8.3 - fix(config): resolve DuplicateOptionError on startup and normalize mapping keys - Remove duplicate case variations from DEFAULT_MAPPINGS - Enforce lowercase normalization and deduplication in load_config - Acknowledge @zxinyun (52pojie) for discovering the root cause --- CHANGELOG.md | 10 +++++++++- CHANGELOG_EN.md | 9 +++++++++ pyproject.toml | 2 +- qpypack/main.py | 10 ++++------ 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c3a1c6..a3a1fbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,15 @@ QPyPack 项目的所有重要变更都将记录在此文件中。 [English Version](./CHANGELOG_EN.md) | **中文** 这里为你准备的 **QPyPack v2.8.1** 精简版 Release/Changelog(分为**中文版**和**英文版**,可直接复制到 GitHub Release 或发布公告中): -这里为你整理的 **精简版 Changelog** 与 **GitHub 提交记录**: + +--- + +## [2.8.3] - 2026-09-05 + +### 修复 +- 修复因默认包名映射表中存在大小写重复键导致启动崩溃的问题(特别鸣谢 52pojie 论坛的 @zxinyun) +- 优化配置项初始化与写入逻辑,在启动和保存时自动对映射表键名进行小写规整与去重处理 +- 增强配置文件解析异常时的回退机制与缺项自动补全的健壮性 --- diff --git a/CHANGELOG_EN.md b/CHANGELOG_EN.md index cb75808..bbcbdb9 100644 --- a/CHANGELOG_EN.md +++ b/CHANGELOG_EN.md @@ -6,6 +6,15 @@ All notable changes to the **QPyPack** project will be documented in this file. --- +## [2.8.3] - 2026-09-05 + +### Fixed +- Fixed a startup crash (`configparser.DuplicateOptionError`) caused by case-insensitive duplicate keys in `DEFAULT_MAPPINGS` (Special thanks to @zxinyun from 52pojie). +- Optimized configuration initialization and saving logic to automatically normalize mapping keys to lowercase and handle deduplication. +- Enhanced robustness of configuration error fallback and missing-key auto-remediation. + +--- + ## [2.8.2] - 2026-09-04 ### Fixed diff --git a/pyproject.toml b/pyproject.toml index e25ac80..3b88d00 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "qpypack" -version = "2.8.2" +version = "2.8.3" description = "A cross-platform GUI packaging and compilation suite based on PyInstaller and Nuitka." readme = "README_EN.md" authors = [ diff --git a/qpypack/main.py b/qpypack/main.py index 804e897..5045c6e 100644 --- a/qpypack/main.py +++ b/qpypack/main.py @@ -125,7 +125,7 @@ except ImportError: HAS_QT_AUDIO = False __app_name__ = "QPyPack" -__version__ = "2.8.2" +__version__ = "2.8.3" __author__ = "QwejayHuang" __company__ = "Qwesoft" __description__ = "Modern Cross-Platform Python Packaging GUI Powered by PyInstaller & Nuitka" @@ -779,9 +779,7 @@ PYPI_MIRRORS_GLOBAL = [ DEFAULT_MAPPINGS = { "crypto": "pycryptodome", - "Crypto": "pycryptodome", "cryptodome": "pycryptodome", - "Cryptodome": "pycryptodome", "nacl": "pynacl", "jwt": "PyJWT", "OpenSSL": "pyOpenSSL", @@ -900,7 +898,7 @@ def load_config(retry=True): default_backup = "https://mirrors.aliyun.com/pypi/simple/" if not os.path.exists(CONFIG_FILE): - config["Mappings"] = DEFAULT_MAPPINGS + config["Mappings"] = {k.lower(): v for k, v in DEFAULT_MAPPINGS.items()} config["Settings"] = { "language": "auto", "engine": "PyInstaller", @@ -950,14 +948,14 @@ def load_config(retry=True): return load_config(retry=False) else: if "Mappings" not in config: - config["Mappings"] = DEFAULT_MAPPINGS + config["Mappings"] = {k.lower(): v for k, v in DEFAULT_MAPPINGS.items()} if "Settings" not in config: config["Settings"] = {} if "BackportRules" not in config: config["BackportRules"] = DEFAULT_BACKPORT_RULES if "Mappings" not in config: - config["Mappings"] = DEFAULT_MAPPINGS + config["Mappings"] = {k.lower(): v for k, v in DEFAULT_MAPPINGS.items()} else: updated_map = False for k, v in DEFAULT_MAPPINGS.items():