Skip to content

On Windows, local file:// asset URLs cannot be uploaded to B2 by the 0.3.4 sink #164

Description

@mark124

On Windows, no asset produced by a connector transfers to B2 through ObjectStorageSink.

The connectors build asset URLs as f"file://{quote(str(path.resolve()))}". On Windows quote() percent-encodes the drive colon and the backslashes, producing file://C%3A%5CUsers%5C..., so urlparse puts the whole path in netloc and leaves path empty. The 0.3.4 sink (genblaze_core/storage/transfer._read_local_file) then does:

path = unquote(parsed.path)      # empty string
resolved = Path(path).resolve()  # resolves to the cwd

which raises StorageError: local file path <cwd> is outside allowed directories. The result is that a Windows producer can never upload an asset to B2.

The standard Path.as_uri() form (file:///C:/...) also fails this sink: Path("/C:/Users/...").resolve() drops the drive separator and yields C:Users\.... The only form 0.3.4 round-trips on Windows is file://C:/Users/... (drive in the authority, forward slashes).

Worth noting: the installed 0.3.4 sink and main disagree. main uses url2pathname, which handles as_uri() correctly, so this is partly release lag, but 0.3.4 is what pip install ships.

A related wrinkle: the AssemblyAI connector validates that a file:// input URL has an empty or localhost netloc, so it requires file:///C:/... and rejects file://C:/..., the exact opposite of what the sink accepts. A Windows pipeline cannot use a single file:// convention throughout.

Suggested fix: build asset URLs with Path.as_uri() in the connectors, and parse local URLs with url2pathname in the 0.3.4 sink (as main already does).

Environment: genblaze-core 0.3.4, genblaze-s3 0.3.4, Python 3.14, Windows 11.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions