Skip to content

Fix encoding-type=url in file listings - #29

Merged
krokicki merged 1 commit into
mainfrom
fix-url-encode-shadowing
Aug 28, 2026
Merged

krokicki merged 1 commit into
mainfrom
fix-url-encode-shadowing

Conversation

@krokicki

@krokicki krokicki commented Aug 28, 2026 •

Copy link
Copy Markdown
Member

get_list_xml's url_encode flag shadowed the url_encode() function it calls to apply EncodingType, so any listing that asked for encoding-type=url raised TypeError: 'bool' object is not callable and returned a 500:

File "x2s3/utils.py", line 130, in get_list_xml
    value = url_encode(value)
TypeError: 'bool' object is not callable

Only the file client was affected — the aioboto client passes url_encode=False, so it never reaches the call. Neuroglancer always sends encoding-type=url (getS3BucketListing in its S3 kvstore appends it unconditionally), so no file target could be browsed from it.

Found while wiring Fileglancer's data links up to virtual_prefix: the very first listing Neuroglancer makes 500s.

Changes

  • Renamed the flag to encode_values and updated the one in-repo caller.
  • New listing test that asks for encoding-type=url against both a plain and a virtual-prefixed target, asserting the echoed EncodingType and the expected keys and common prefixes.
  • Version bumped to 1.5.1.

Full suite passes (80).

@StephanPreibisch

get_list_xml's url_encode flag shadowed the url_encode() function it calls
to apply EncodingType, so any listing that asked for encoding-type=url
raised "TypeError: 'bool' object is not callable" and returned a 500.

Only the file client was affected: the aioboto client passes
url_encode=False and never reaches the call. Neuroglancer always sends
encoding-type=url, so no file target could be browsed from it.

Renamed the flag to encode_values, and added a listing test that asks for
encoding-type=url on both a plain and a virtual-prefixed target.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@krokicki
krokicki merged commit 7ef7d64 into main Aug 28, 2026
5 checks passed
@krokicki
krokicki deleted the fix-url-encode-shadowing branch August 28, 2026 02:25
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.

1 participant