adds early exit if url is `PathLike`
{'login': 'vvvm23', 'id': 44398246, 'node_id': 'MDQ6VXNlcjQ0Mzk4MjQ2', 'avatar_url': 'https://avatars.githubusercontent.com/u/44398246?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/vvvm23', 'html_url': 'https://github.com/vvvm23', 'followers_url': 'https://api.github.com/users/vvvm23/followers', 'following_url': 'https://api.github.com/users/vvvm23/following{/other_user}', 'gists_url': 'https://api.github.com/users/vvvm23/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/vvvm23/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/vvvm23/subscriptions', 'organizations_url': 'https://api.github.com/users/vvvm23/orgs', 'repos_url': 'https://api.github.com/users/vvvm23/repos', 'events_url': 'https://api.github.com/users/vvvm23/events{/privacy}', 'received_events_url': 'https://api.github.com/users/vvvm23/received_events', 'type': 'User', 'site_admin': False}
[]
[]
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/datasets/pr_5630). All of your documentation changes will be reflected on that endpoint.
Closes #4864 

Should fix errors thrown when attempting to load `json` dataset using `pathlib.Path` in `data_files` argument.
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/5630/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}
{'url': 'https://api.github.com/repos/huggingface/datasets/pulls/5630', 'html_url': 'https://github.com/huggingface/datasets/pull/5630', 'diff_url': 'https://github.com/huggingface/datasets/pull/5630.diff', 'patch_url': 'https://github.com/huggingface/datasets/pull/5630.patch', 'merged_at': None}