Skip to content

Local file:// URLs with URL-escaped paths fail to open on LocalFileSystem #1056

@Sharon-codes

Description

@Sharon-codes

Bug summary

When a local dataset path is provided via ile:// URI and contains escaped characters (e.g. %20, %27), _init_filesystem() passes the escaped path through to LocalFileSystem. This causes FileNotFoundError when opening files.

Reproduction

  1. Create a local directory whose name contains spaces or apostrophes.
  2. Convert it to URI using Path(...).as_uri().
  3. Call _init_filesystem(uri).
  4. Attempt s.open(f"{path}/v3-config.json").

Actual behavior

The returned path still contains URL-escaped characters and file open fails.

Expected behavior

For local filesystems, URL-escaped characters should be decoded before file operations.

Proposed fix

After url_to_fs(...), detect local protocols ( ile/local) and apply URL decoding (urllib.parse.unquote) to the resolved path before returning it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions