File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,8 @@ def test_read_wheel_empty_metadata(tmpdir):
9696
9797 with pytest .raises (
9898 exceptions .InvalidDistribution ,
99- match = re .escape (f"No METADATA in archive: { whl_file } " ),
99+ match = re .escape (
100+ f"No METADATA in archive or METADATA missing 'Metadata-Version': { whl_file } "
101+ ),
100102 ):
101103 wheel .Wheel (whl_file )
Original file line number Diff line number Diff line change @@ -73,16 +73,21 @@ def read_file(name: str) -> bytes:
7373 "Not a known archive format for file: %s" % fqn
7474 )
7575
76+ searched_files : List [str ] = []
7677 try :
7778 for path in self .find_candidate_metadata_files (names ):
7879 candidate = "/" .join (path )
7980 data = read_file (candidate )
8081 if b"Metadata-Version" in data :
8182 return data
83+ searched_files .append (candidate )
8284 finally :
8385 archive .close ()
8486
85- raise exceptions .InvalidDistribution ("No METADATA in archive: %s" % fqn )
87+ raise exceptions .InvalidDistribution (
88+ "No METADATA in archive or METADATA missing 'Metadata-Version': "
89+ "%s (searched %s)" % (fqn , "," .join (searched_files ))
90+ )
8691
8792 def parse (self , data : bytes ) -> None :
8893 super ().parse (data )
You can’t perform that action at this time.
0 commit comments