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
This commit is contained in:
QwejayHuang committed 2026-09-05 23:25:00 +08:00
1 parent 46e1717e57
commit 3f8922b83f
4 files changed
+23 -8

No files matched your search

+9 -1
View File
@@ -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)
- 优化配置项初始化与写入逻辑,在启动和保存时自动对映射表键名进行小写规整与去重处理
- 增强配置文件解析异常时的回退机制与缺项自动补全的健壮性
---
+9
View File
@@ -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
+1 -1
View File
@@ -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 = [
+4 -6
View File
@@ -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():