Skip to content

Commit 6dc05a8

Browse files
authored
Merge pull request #446 from scikit-learn-contrib/378-documentation-interrupted-due-to-an-invalid-ssl-certificate
chore: Update urllib to requests for downloading data
2 parents 1b57a04 + da15fa2 commit 6dc05a8

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

HISTORY.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ History
77

88
* Fix conda versionning.
99
* Reduce precision for test in `MapieCalibrator`.
10+
* Fix invalid certificate when downloading data.
1011

1112
0.8.3 (2024-03-01)
1213
------------------

examples/regression/3-scientific-articles/plot_kim2020_simulations.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@
3030
"""
3131
from __future__ import annotations
3232

33-
import ssl
33+
import requests
3434
from io import BytesIO
3535
from typing import Any, Optional, Tuple
36-
from urllib.request import urlopen
3736
from zipfile import ZipFile
3837

3938
import matplotlib.pyplot as plt
@@ -69,9 +68,8 @@ def get_X_y() -> Tuple[NDArray, NDArray]:
6968
zip_folder = "BlogFeedback.zip"
7069
csv_file = "blogData_train.csv"
7170
url = website + page + folder + zip_folder
72-
ssl._create_default_https_context = ssl._create_unverified_context
73-
resp = urlopen(url)
74-
zipfile = ZipFile(BytesIO(resp.read()))
71+
response = requests.get(url)
72+
zipfile = ZipFile(BytesIO(response.content))
7573
df = pd.read_csv(zipfile.open(csv_file)).to_numpy()
7674
X = df[:, :-1]
7775
y = np.log(1 + df[:, -1])

0 commit comments

Comments
 (0)