File tree 2 files changed +9
-2
lines changed
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):
96
96
97
97
with pytest .raises (
98
98
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
+ ),
100
102
):
101
103
wheel .Wheel (whl_file )
Original file line number Diff line number Diff line change @@ -73,16 +73,21 @@ def read_file(name: str) -> bytes:
73
73
"Not a known archive format for file: %s" % fqn
74
74
)
75
75
76
+ searched_files : List [str ] = []
76
77
try :
77
78
for path in self .find_candidate_metadata_files (names ):
78
79
candidate = "/" .join (path )
79
80
data = read_file (candidate )
80
81
if b"Metadata-Version" in data :
81
82
return data
83
+ searched_files .append (candidate )
82
84
finally :
83
85
archive .close ()
84
86
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
+ )
86
91
87
92
def parse (self , data : bytes ) -> None :
88
93
super ().parse (data )
You can’t perform that action at this time.
0 commit comments