From 78cbc3ffbfdb325efab438bb710a35f779c0920c Mon Sep 17 00:00:00 2001 From: elhoim Date: Mon, 31 Aug 2026 00:10:59 +0000 Subject: [PATCH] Use PyPI API filename field for duplicate-distribution check The duplicate-distribution filter reconstructed the comparison filename by unquoting the basename of file_info['url'], instead of using file_info['filename'] which PyPI's JSON API already provides directly. Under PEP 625 sdist name normalization, the URL path and the actual filename can diverge, defeating the duplicate check and causing re-uploads or upload failures. Use file_info['filename'] directly. --- .github/workflows/pypi-publish.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 48a95d5..41330c7 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -58,7 +58,6 @@ jobs: import os from pathlib import Path from urllib.error import HTTPError - from urllib.parse import unquote, urlparse from urllib.request import urlopen project = "misp-modules-cli" @@ -76,7 +75,7 @@ jobs: if "existing_filenames" not in locals(): existing_filenames = { - unquote(Path(urlparse(file_info["url"]).path).name) + file_info["filename"] for files in payload.get("releases", {}).values() for file_info in files }