fsspec / fsspec/filesystem_spec

utils.infer_storage_options does not support passwords with hashes

Open Beginner friendly
#171 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.4k
Forks
490
Avg merge
2d 3h
Merged PRs (30d)
38

Description

print (fsspec.utils.infer_storage_options('ftp://user:password@host:21/path'))
{'protocol': 'ftp', 'path': '/path', 'host': 'host', 'port': 21, 'username': 'user', 'password': 'password'}

print (fsspec.utils.infer_storage_options('ftp://user:password#@host:21/path'))

Traceback (most recent call last):
  File "filesystem.py", line 481, in <module>
    print (fsspec.utils.infer_storage_options('ftp://user:password#@host:21/path'))
  File "...\lib\site-packages\fsspec\utils.py", line 72, in infer_storage_options
    if parsed_path.port:
  File "...\lib\urllib\parse.py", line 167, in port
    port = int(port, 10)
ValueError: invalid literal for int() with base 10: 'password'

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in fsspec.utils.infer_storage_options, at the parsing logic around utils.py line 72, and reproduce the two FTP examples from the issue. Check how a hash in the password affects parsed_path.port; done means the hashed-password URL is accepted and returns storage options with the password parsed correctly, while the existing example still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.