Skip to content

Commit ac3b903

Browse files
committed
update HTTPClient for zip files
1 parent b3e9ab1 commit ac3b903

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

openml/_api/clients/http.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,13 @@ def _get_body_filename_from_response(self, response: Response) -> str:
9999
if "text/xml" in content_type:
100100
return "body.xml"
101101

102+
if response.content.startswith(b"PK\x03\x04"):
103+
return "body.zip"
104+
102105
try:
103106
arff.loads(response.text)
104107
return "body.arff"
105-
except arff.BadDataFormat:
108+
except arff.ArffException:
106109
pass
107110

108111
return "body.txt"
@@ -117,6 +120,9 @@ def _get_body_filename_from_path(self, path: Path) -> str:
117120
if (path / "body.arff").exists():
118121
return "body.arff"
119122

123+
if (path / "body.zip").exists():
124+
return "body.zip"
125+
120126
return "body.txt"
121127

122128
def load(self, key: str) -> Response:

0 commit comments

Comments
 (0)