From cc89b4a7f1925a6a789256b692d9f2f459564e05 Mon Sep 17 00:00:00 2001 From: Maxime Boissonneault Date: Thu, 18 Jul 2024 18:31:38 -0400 Subject: [PATCH] =?UTF-8?q?Allow=20RECORD=20in=20subfolders,=20such=20as?= =?UTF-8?q?=20what=20is=20provided=20in=20'py',=20which=20c=E2=80=A6=20(#2?= =?UTF-8?q?0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wheelfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wheelfile.py b/wheelfile.py index b9bbce3..60b9b81 100644 --- a/wheelfile.py +++ b/wheelfile.py @@ -730,7 +730,8 @@ def update(self, arcpath: str, buf: IO[bytes]): assert buf.tell() == 0, ( f"Stale buffer given - current position: {buf.tell()}." ) - assert not arcpath.endswith('.dist-info/RECORD'), ( + # if .dist-info/RECORD is not in a subdirectory, it is not allowed + assert "/" in arcpath.replace('.dist-info/RECORD',"") or not arcpath.endswith('.dist-info/RECORD'), ( f"Attempt to add an entry for a RECORD file to the RECORD: " f"{repr(arcpath)}." )