datasets doesn't support # in data paths
MEMBER
`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
```
2022-10-11T11:34:51Z
https://github.com/huggingface/datasets/issues/5099#issuecomment-1274541998
https://api.github.com/repos/huggingface/datasets/issues/5099
IC_kwDODunzps5L9_eu
https://api.github.com/repos/huggingface/datasets/issues/comments/1274541998/reactions
2022-10-11T11:34:51Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1274541998
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
CONTRIBUTOR
I'll work on this :)
2022-10-11T13:20:04Z
https://github.com/huggingface/datasets/issues/5099#issuecomment-1274676725
https://api.github.com/repos/huggingface/datasets/issues/5099
IC_kwDODunzps5L-gX1
https://api.github.com/repos/huggingface/datasets/issues/comments/1274676725/reactions
2022-10-11T13:21:47Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1274676725
https://avatars.githubusercontent.com/u/9295277?v=4
https://api.github.com/users/riccardobucco/events{/privacy}
https://api.github.com/users/riccardobucco/followers
https://api.github.com/users/riccardobucco/following{/other_user}
https://api.github.com/users/riccardobucco/gists{/gist_id}
https://github.com/riccardobucco
riccardobucco
MDQ6VXNlcjkyOTUyNzc=
https://api.github.com/users/riccardobucco/orgs
https://api.github.com/users/riccardobucco/received_events
https://api.github.com/users/riccardobucco/repos
https://api.github.com/users/riccardobucco/starred{/owner}{/repo}
https://api.github.com/users/riccardobucco/subscriptions
User
https://api.github.com/users/riccardobucco
public
CONTRIBUTOR
@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?
2022-10-11T13:31:36Z
https://github.com/huggingface/datasets/issues/5099#issuecomment-1274691979
https://api.github.com/repos/huggingface/datasets/issues/5099
IC_kwDODunzps5L-kGL
https://api.github.com/repos/huggingface/datasets/issues/comments/1274691979/reactions
2022-10-11T13:31:36Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1274691979
https://avatars.githubusercontent.com/u/9295277?v=4
https://api.github.com/users/riccardobucco/events{/privacy}
https://api.github.com/users/riccardobucco/followers
https://api.github.com/users/riccardobucco/following{/other_user}
https://api.github.com/users/riccardobucco/gists{/gist_id}
https://github.com/riccardobucco
riccardobucco
MDQ6VXNlcjkyOTUyNzc=
https://api.github.com/users/riccardobucco/orgs
https://api.github.com/users/riccardobucco/received_events
https://api.github.com/users/riccardobucco/repos
https://api.github.com/users/riccardobucco/starred{/owner}{/repo}
https://api.github.com/users/riccardobucco/subscriptions
User
https://api.github.com/users/riccardobucco
public
MEMBER
I think you can create a dataset repository on the Hub with a dummy file containing a `#`
2022-10-11T13:53:47Z
https://github.com/huggingface/datasets/issues/5099#issuecomment-1274724547
https://api.github.com/repos/huggingface/datasets/issues/5099
IC_kwDODunzps5L-sDD
https://api.github.com/repos/huggingface/datasets/issues/comments/1274724547/reactions
2022-10-11T13:53:47Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1274724547
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
NONE
Ah sorry it was private I just made it public, I can also help with this if needed
2022-10-11T13:54:53Z
https://github.com/huggingface/datasets/issues/5099#issuecomment-1274727000
https://api.github.com/repos/huggingface/datasets/issues/5099
IC_kwDODunzps5L-spY
https://api.github.com/repos/huggingface/datasets/issues/comments/1274727000/reactions
2022-10-11T13:54:53Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1274727000
https://avatars.githubusercontent.com/u/44069155?v=4
https://api.github.com/users/loubnabnl/events{/privacy}
https://api.github.com/users/loubnabnl/followers
https://api.github.com/users/loubnabnl/following{/other_user}
https://api.github.com/users/loubnabnl/gists{/gist_id}
https://github.com/loubnabnl
loubnabnl
MDQ6VXNlcjQ0MDY5MTU1
https://api.github.com/users/loubnabnl/orgs
https://api.github.com/users/loubnabnl/received_events
https://api.github.com/users/loubnabnl/repos
https://api.github.com/users/loubnabnl/starred{/owner}{/repo}
https://api.github.com/users/loubnabnl/subscriptions
User
https://api.github.com/users/loubnabnl
public
CONTRIBUTOR
@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.
2022-10-11T14:26:16Z
https://github.com/huggingface/datasets/issues/5099#issuecomment-1274781209
https://api.github.com/repos/huggingface/datasets/issues/5099
IC_kwDODunzps5L-54Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1274781209/reactions
2022-10-11T14:26:16Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1274781209
https://avatars.githubusercontent.com/u/9295277?v=4
https://api.github.com/users/riccardobucco/events{/privacy}
https://api.github.com/users/riccardobucco/followers
https://api.github.com/users/riccardobucco/following{/other_user}
https://api.github.com/users/riccardobucco/gists{/gist_id}
https://github.com/riccardobucco
riccardobucco
MDQ6VXNlcjkyOTUyNzc=
https://api.github.com/users/riccardobucco/orgs
https://api.github.com/users/riccardobucco/received_events
https://api.github.com/users/riccardobucco/repos
https://api.github.com/users/riccardobucco/starred{/owner}{/repo}
https://api.github.com/users/riccardobucco/subscriptions
User
https://api.github.com/users/riccardobucco
public
CONTRIBUTOR
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))
```
2022-10-11T14:55:17Z
https://github.com/huggingface/datasets/issues/5099#issuecomment-1274831934
https://api.github.com/repos/huggingface/datasets/issues/5099
IC_kwDODunzps5L_GQ-
https://api.github.com/repos/huggingface/datasets/issues/comments/1274831934/reactions
2022-10-11T14:55:57Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1274831934
https://avatars.githubusercontent.com/u/9295277?v=4
https://api.github.com/users/riccardobucco/events{/privacy}
https://api.github.com/users/riccardobucco/followers
https://api.github.com/users/riccardobucco/following{/other_user}
https://api.github.com/users/riccardobucco/gists{/gist_id}
https://github.com/riccardobucco
riccardobucco
MDQ6VXNlcjkyOTUyNzc=
https://api.github.com/users/riccardobucco/orgs
https://api.github.com/users/riccardobucco/received_events
https://api.github.com/users/riccardobucco/repos
https://api.github.com/users/riccardobucco/starred{/owner}{/repo}
https://api.github.com/users/riccardobucco/subscriptions
User
https://api.github.com/users/riccardobucco
public
MEMBER
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. !
2022-10-12T10:10:52Z
https://github.com/huggingface/datasets/issues/5099#issuecomment-1275923248
https://api.github.com/repos/huggingface/datasets/issues/5099
IC_kwDODunzps5MDQsw
https://api.github.com/repos/huggingface/datasets/issues/comments/1275923248/reactions
2022-10-12T10:10:52Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1275923248
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
MEMBER
Should be fixed by https://github.com/huggingface/datasets/issues/5099 - we'll do a release later today
2022-10-12T15:25:16Z
https://github.com/huggingface/datasets/issues/5099#issuecomment-1276361567
https://api.github.com/repos/huggingface/datasets/issues/5099
IC_kwDODunzps5ME7tf
https://api.github.com/repos/huggingface/datasets/issues/comments/1276361567/reactions
2022-10-12T15:25:16Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1276361567
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
## 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 