Getting HTTPError: HTTP Error 403: Forbidden when trying to load California Housing dataset

### Describe the bug

When trying to load the dataset I get an error.

### Steps/Code to Reproduce

```
from sklearn.datasets import fetch_california_housing
from sklearn.model_selection import train_test_split 
from sklearn.preprocessing import StandardScaler

housing = fetch_california_housing()

X_train_full, X_test, y_train_full, y_test = train_test_split(
housing.data, housing.target)
X_train, X_valid, y_train, y_valid = train_test_split(X_train_full, y_train_full)

scaler = StandardScaler()
X_train_scaled = scaler.fit_transform(X_train)
X_valid_scaled = scaler.transform(X_valid)
X_test_scaled = scaler.transform(X_test)
```

### Expected Results

Dataset loads

### Actual Results

```
HTTPError                                 Traceback (most recent call last)
[/var/folders/wx/mz49j6yd5514yjn5k60sk6900000gn/T/ipykernel_16344/1379907178.py](https://file+.vscode-resource.vscode-cdn.net/var/folders/wx/mz49j6yd5514yjn5k60sk6900000gn/T/ipykernel_16344/1379907178.py) in <module>
      3 from sklearn.preprocessing import StandardScaler
      4 
----> 5 housing = fetch_california_housing()
      6 
      7 X_train_full, X_test, y_train_full, y_test = train_test_split(

[~/opt/anaconda3/lib/python3.9/site-packages/sklearn/datasets/_california_housing.py](https://file+.vscode-resource.vscode-cdn.net/Users/aryamanbhatia/neural%20network%20for%20practice/~/opt/anaconda3/lib/python3.9/site-packages/sklearn/datasets/_california_housing.py) in fetch_california_housing(data_home, download_if_missing, return_X_y, as_frame)
    133     This dataset consists of 20,640 samples and 9 features.
    134     """
--> 135     data_home = get_data_home(data_home=data_home)
    136     if not exists(data_home):
    137         makedirs(data_home)

[~/opt/anaconda3/lib/python3.9/site-packages/sklearn/datasets/_base.py](https://file+.vscode-resource.vscode-cdn.net/Users/aryamanbhatia/neural%20network%20for%20practice/~/opt/anaconda3/lib/python3.9/site-packages/sklearn/datasets/_base.py) in _fetch_remote(remote, dirname)

[~/opt/anaconda3/lib/python3.9/urllib/request.py](https://file+.vscode-resource.vscode-cdn.net/Users/aryamanbhatia/neural%20network%20for%20practice/~/opt/anaconda3/lib/python3.9/urllib/request.py) in urlretrieve(url, filename, reporthook, data)
    237     url_type, path = _splittype(url)
    238 
--> 239     with contextlib.closing(urlopen(url, data)) as fp:
    240         headers = fp.info()
    241 
...
--> 641         raise HTTPError(req.full_url, code, msg, hdrs, fp)
    642 
    643 class HTTPRedirectHandler(BaseHandler):

HTTPError: HTTP Error 403: Forbidden
```

### Versions

```shell
System:
    python: 3.9.13 (main, Aug 25 2022, 18:29:29)  [Clang 12.0.0 ]
executable: /Users/aryamanbhatia/opt/anaconda3/bin/python
   machine: macOS-10.16-x86_64-i386-64bit

Python dependencies:
          pip: 22.2.2
   setuptools: 63.4.1
      sklearn: 1.0.2
        numpy: 1.26.3
        scipy: 1.9.1
       Cython: 0.29.32
       pandas: 1.4.4
   matplotlib: 3.5.2
       joblib: 1.1.0
threadpoolctl: 2.2.0

Built with OpenMP: True
```

COMMENT:
FWIW I tried again on Google Colab today and `sklearn.datasets.fetch_california_housing` worked ... In both working and non working cases, the IP address I was getting inside Colab seemed to come from the US, according to websites like https://iplocation.com/.

Below I post the output of `wget` inside a Colab session where `fetch_california_housing` works. Not sure if there is a command that would be more useful to run next time we can reproduce the issue.

```bash
# Use !wget with ! at the beginning inside Colab
!wget https://ndownloader.figshare.com/files/5976036
```

```
--2024-06-10 14:27:58--  https://ndownloader.figshare.com/files/5976036
Resolving ndownloader.figshare.com (ndownloader.figshare.com)... 34.247.104.150, 34.248.16.15, 52.209.182.24, ...
Connecting to ndownloader.figshare.com (ndownloader.figshare.com)|34.247.104.150|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://s3-eu-west-1.amazonaws.com/pfigshare-u-files/5976036/cal_housing.tgz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIYCQYOYV5JSSROOA/20240610/eu-west-1/s3/aws4_request&X-Amz-Date=20240610T142758Z&X-Amz-Expires=10&X-Amz-SignedHeaders=host&X-Amz-Signature=70632a1b1291980f200baf2baa7aae34459f94a56d641f0a22c9291663dd04cc [following]
--2024-06-10 14:27:58--  https://s3-eu-west-1.amazonaws.com/pfigshare-u-files/5976036/cal_housing.tgz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIYCQYOYV5JSSROOA/20240610/eu-west-1/s3/aws4_request&X-Amz-Date=20240610T142758Z&X-Amz-Expires=10&X-Amz-SignedHeaders=host&X-Amz-Signature=70632a1b1291980f200baf2baa7aae34459f94a56d641f0a22c9291663dd04cc
Resolving s3-eu-west-1.amazonaws.com (s3-eu-west-1.amazonaws.com)... 52.92.36.48, 52.92.0.64, 52.218.28.243, ...
Connecting to s3-eu-west-1.amazonaws.com (s3-eu-west-1.amazonaws.com)|52.92.36.48|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 441963 (432K) [binary/octet-stream]
Saving to: ‘5976036’

5976036             100%[===================>] 431.60K  1.01MB/s    in 0.4s    

2024-06-10 14:27:59 (1.01 MB/s) - ‘5976036’ saved [441963/441963]
```

Since it seems like the requests gets a HTTP 302 from `ndownloader.figshare.com` and then goes to a S3 bucket on AWS, a wild guess may be that the HTTP 403 was coming from AWS? Edit: maybe not, at least https://github.com/googlecolab/colabtools/issues/4601 screenshot seem to indicate that the HTTP 403 happens on `ndownloader.figshare.com`.

Labels: Bug