datasets doesn't support # in data paths
{'login': 'loubnabnl', 'id': 44069155, 'node_id': 'MDQ6VXNlcjQ0MDY5MTU1', 'avatar_url': 'https://avatars.githubusercontent.com/u/44069155?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/loubnabnl', 'html_url': 'https://github.com/loubnabnl', 'followers_url': 'https://api.github.com/users/loubnabnl/followers', 'following_url': 'https://api.github.com/users/loubnabnl/following{/other_user}', 'gists_url': 'https://api.github.com/users/loubnabnl/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/loubnabnl/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/loubnabnl/subscriptions', 'organizations_url': 'https://api.github.com/users/loubnabnl/orgs', 'repos_url': 'https://api.github.com/users/loubnabnl/repos', 'events_url': 'https://api.github.com/users/loubnabnl/events{/privacy}', 'received_events_url': 'https://api.github.com/users/loubnabnl/received_events', 'type': 'User', 'site_admin': False}
[{'id': 1935892857, 'node_id': 'MDU6TGFiZWwxOTM1ODkyODU3', 'url': 'https://api.github.com/repos/huggingface/datasets/labels/bug', 'name': 'bug', 'color': 'd73a4a', 'default': True, 'description': "Something isn't working"}, {'id': 1935892877, 'node_id': 'MDU6TGFiZWwxOTM1ODkyODc3', 'url': 'https://api.github.com/repos/huggingface/datasets/labels/good%20first%20issue', 'name': 'good first issue', 'color': '7057ff', 'default': True, 'description': 'Good for newcomers'}, {'id': 4614514401, 'node_id': 'LA_kwDODunzps8AAAABEwvm4Q', 'url': 'https://api.github.com/repos/huggingface/datasets/labels/hacktoberfest', 'name': 'hacktoberfest', 'color': 'DF8D62', 'default': False, 'description': ''}]
{'login': 'riccardobucco', 'id': 9295277, 'node_id': 'MDQ6VXNlcjkyOTUyNzc=', 'avatar_url': 'https://avatars.githubusercontent.com/u/9295277?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/riccardobucco', 'html_url': 'https://github.com/riccardobucco', 'followers_url': 'https://api.github.com/users/riccardobucco/followers', 'following_url': 'https://api.github.com/users/riccardobucco/following{/other_user}', 'gists_url': 'https://api.github.com/users/riccardobucco/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/riccardobucco/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/riccardobucco/subscriptions', 'organizations_url': 'https://api.github.com/users/riccardobucco/orgs', 'repos_url': 'https://api.github.com/users/riccardobucco/repos', 'events_url': 'https://api.github.com/users/riccardobucco/events{/privacy}', 'received_events_url': 'https://api.github.com/users/riccardobucco/received_events', 'type': 'User', 'site_admin': False}
[{'login': 'riccardobucco', 'id': 9295277, 'node_id': 'MDQ6VXNlcjkyOTUyNzc=', 'avatar_url': 'https://avatars.githubusercontent.com/u/9295277?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/riccardobucco', 'html_url': 'https://github.com/riccardobucco', 'followers_url': 'https://api.github.com/users/riccardobucco/followers', 'following_url': 'https://api.github.com/users/riccardobucco/following{/other_user}', 'gists_url': 'https://api.github.com/users/riccardobucco/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/riccardobucco/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/riccardobucco/subscriptions', 'organizations_url': 'https://api.github.com/users/riccardobucco/orgs', 'repos_url': 'https://api.github.com/users/riccardobucco/repos', 'events_url': 'https://api.github.com/users/riccardobucco/events{/privacy}', 'received_events_url': 'https://api.github.com/users/riccardobucco/received_events', 'type': 'User', 'site_admin': False}]
`datasets` doesn't seem to urlencode the directory names here

https://github.com/huggingface/datasets/blob/7feeb5648a63b6135a8259dedc3b1e19185ee4c7/src/datasets/utils/file_utils.py#L109-L111

for example we should have
```python
from datasets.utils.file_utils import hf_hub_url

url = hf_hub_url("loubnabnl/bigcode_csharp", "data/c#/data_0003.jsonl")
print(url)
# Currently returns
# https://huggingface.co/datasets/loubnabnl/bigcode_csharp/resolve/main/data/c#/data_0003.jsonl
# while it should be 
# https://huggingface.co/datasets/loubnabnl/bigcode_csharp/resolve/main/data/c%23/data_0003.jsonl
``` I'll work on this :) @loubnabnl The dataset you linked in the description of the bug does not work and returns a 404. Where can I find the dataset to reproduce the bug? I think you can create a dataset repository on the Hub with a dummy file containing a `#` Ah sorry it was private I just made it public, I can also help with this if needed @lhoestq Should I url encode also repo_id and revision parameters? I'm not sure what are the valid characters there.

Personally, I would be cautious and only url encode the path parameter. These are possible solutions (assuming `from urllib.parse import quote`):

1) url encode only the path parameter:
```
# src/datasets/utils/file_utils.py
def hf_hub_url(repo_id: str, path: str, revision: Optional[str] = None) -> str:
    revision = revision or config.HUB_DEFAULT_VERSION
    return config.HUB_DATASETS_URL.format(repo_id=repo_id, path=quote(path), revision=revision)
```
2) url encode all parameters:
```
# src/datasets/utils/file_utils.py
def hf_hub_url(repo_id: str, path: str, revision: Optional[str] = None) -> str:
    revision = revision or config.HUB_DEFAULT_VERSION
    return config.HUB_DATASETS_URL.format(repo_id=quote(repo_id), path=quote(path), revision=quote(revision))
```
3) url encode the whole url:
```
# src/datasets/config.py
HUB_DATASETS_PATH = "/datasets/{repo_id}/resolve/{revision}/{path}"
HUB_DATASETS_URL = HF_ENDPOINT + HUB_DATASETS_PATH
```
```
# src/datasets/utils/file_utils.py
def hf_hub_url(repo_id: str, path: str, revision: Optional[str] = None) -> str:
    revision = revision or config.HUB_DEFAULT_VERSION
    return config.HF_ENDPOINT + quote(config.HUB_DATASETS_PATH.format(repo_id=repo_id, path=path, revision=revision))
``` repo_id can only contain alphanumeric characters and _- so it doesn't need to be encoded.

However I agree it's a good idea to also apply `quote` to the revision as well as in 2. ! Should be fixed by https://github.com/huggingface/datasets/issues/5099 - we'll do a release later today
## Describe the bug
dataset files with `#` symbol their paths aren't read correctly.

## Steps to reproduce the bug
The data in folder `c#`of this [dataset](https://huggingface.co/datasets/loubnabnl/bigcode_csharp) can't be loaded. While the folder `c_sharp` with the same data is loaded properly
```python
ds = load_dataset('loubnabnl/bigcode_csharp', split="train", data_files=["data/c#/*"])
```
```
FileNotFoundError: Couldn't find file at https://huggingface.co/datasets/loubnabnl/bigcode_csharp/resolve/27a3166cff4bb18e11919cafa6f169c0f57483de/data/c#/data_0003.jsonl
```

## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: macOS-12.2.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.3

cc @lhoestq 
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/5099/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}