Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N
rpinho
requested review from
BrianWhitneyAI,
aswallace,
kmitcham,
pgarrison,
saeliddp,
smishra3 and
toloudis
November 26, 2026 01:39
|
|
||
| import pathlib | ||
| from functools import partial | ||
| from http.server import HTTPServer, SimpleHTTPRequestHandler |
Contributor
There was a problem hiding this comment.
This testing method is a little unconventional for the bioio suite, not saying its wrong but Id like to do a little more reading on it before merging
Author
|
Hey @BrianWhitneyAI, Yeah, that makes sense — #91 looks much better and simpler. I think that's fine for Can close this out once #91 is merged. Thanks for getting this done! |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to Relevant Issue
Addresses bioio-devs/bioio#239.
Who hits this:
bioio/bioio-cziusers opening HTTP(S) image URLs whose path contains literal spaces or non-ASCII characters (bioio-devs/bioio#239).Description of Changes
pathlike_to_fs()currently returnshttp://andhttps://URLs with literal spaces untouched. Whilefsspec/aiohttpescape those paths internally when fetching (so TIFF/OME-TIFF reads succeed), readers that hand the returned URL straight to a native HTTP client (such asbioio-czipassing the URL toaicspylibczi'slibCZIcurl stream) fail withcurl_url_set(..) failed with error code 3 (Malformed input to a URL function)before any request is sent.Changes:
bioio_base/io.py(pathlike_to_fs), percent-encode only the path component ofhttp://andhttps://URLs usingurllib.parse.quote(..., safe="/%:@!$&'()*+,;=[]"), matching the path directly so literal tabs/newlines are encoded rather than stripped byurlsplit.%XXescapes (no double-encoding of%20or%2520),=in filenames,fsspecglob characters, query strings (e.g. presigned S3 query params), fragments, and all non-HTTP schemes (s3://,gs://,file://, and local filesystem paths with spaces).bioio_base/tests/test_io.pycovering literal spaces, already-encoded%20, multiple spaces + Unicode, tabs/queries/fragments onhttps://, and local/file://paths with spaces.Tests:
bioio_base/tests/test_io.py: 3 fail / 2 control pass onmain(d933a203); 5/5 pass with this fix.bioio-basesuite: 146 passed, 35 xfailed (0 regressions vs 141 passed, 35 xfailed onmain).bioio-czi(aicspylibczi 4.0.1): literal-space CZI URLs now match%20URLs and local files byte-for-byte on dims, pixels, and metadata.ruff,ruff-format, andmypypass on all touched files.Found and written with AI agents; a separate AI referee reproduced the bug and verified the patch independently before this PR.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N