Skip to content
This repository was archived by the owner on Oct 16, 2025. It is now read-only.
This repository was archived by the owner on Oct 16, 2025. It is now read-only.

Windows paths with driver letters not supported #31

@FelixSchwarz

Description

@FelixSchwarz

I'm trying to use requests-file on Windows using an absolute path like this: "file://C:/foo/bar".

The problem is that the current code uses urlparse() and .netloc contains "C:" in that case which triggers an exception:

if url_parts.netloc and url_parts.netloc != "localhost":

Just to demonstrate the problem:

>>> from requests.compat import urlparse
>>> urlparse('file://C:/foo/bar')
ParseResult(scheme='file', netloc='C:', path='/foo/bar', params='', query='', fragment='')

Background: I'm trying to add support for local repositories in conda-lock and that project tries to support also Windows users.

Do you think we could add a workaround to support Windows drive letters? (just on Windows)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions