Skip to content

Bugfix: percent-encode HTTP(S) URL paths in pathlike_to_fs - #91

Open
BrianWhitneyAI wants to merge 1 commit into
mainfrom
bugfix/escape-http-url-spaces
Open

BrianWhitneyAI wants to merge 1 commit into
mainfrom
bugfix/escape-http-url-spaces

Conversation

@BrianWhitneyAI

@BrianWhitneyAI BrianWhitneyAI commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Link to Relevant Issue

Resolves bioio-devs/bioio#239

Description of Changes

pathlike_to_fs returned http(s) URLs with literal spaces unchanged. fsspec/aiohttp escape these when fetching, but some backends such as inbioio-czi hand the path to libCZI's curl stream, which doesnt support unencoded urls.

  • bioio_base/io.py: for http:// and https:// paths, a single urllib.parse.quote call with all URL delimiters (and %) marked safe. Only spaces, non-ASCII and other illegal characters are encoded; existing %XX escapes are not double-encoded. s3://, other schemes and local paths are untouched as they are not effected.

Credit to @rpinho for diagnosing the issue and the original approach in #90, which this simplifies.

🤖 Generated with Claude Code

Native HTTP clients such as libCZI's curl stream reject URLs with literal
spaces. Encode http(s) paths so they are valid, keeping existing escapes.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spaces in URL break reader (bioio-czi minimum)

1 participant