Skip to content

Question: syntax for abs paths passed as file:// URLs in Windows? #3730

@jaimergp

Description

@jaimergp

What's the actual way? Given this absolute path in Windows D:\a_\temp\popen-gw0\test_croot_with_spaces0\space path:

>>> from libmambapy.specs import CondaURL
>>> CondaURL.parse("file:///D:/a/_temp/popen-gw0/test_croot_with_spaces0/space path")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
libmambapy.bindings.specs.ParseError: Failed to parse URL "file:///D:/a/_temp/popen-gw0/test_croot_with_spaces0/space path": Malformed input to a URL function
>>> CondaURL.parse("file:///D:/a/_temp/popen-gw0/test_croot_with_spaces0/space%20path
")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
libmambapy.bindings.specs.ParseError: Failed to parse URL "file:///D:/a/_temp/popen-gw0/test_croot_with_spaces0/space%20path": Bad file:// URL
>>> CondaURL.parse("file:///D/a/_temp/popen-gw0/test_croot_with_spaces0/space path")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
libmambapy.bindings.specs.ParseError: Failed to parse URL "file:///D/a/_temp/popen-gw0/test_croot_with_spaces0/space path": Malformed input to a URL function
>>> CondaURL.parse("file:///D/a/_temp/popen-gw0/test_croot_with_spaces0/space%20path"
)
file:///D/a/_temp/popen-gw0/test_croot_with_spaces0/space%20path

Only the last one (without the : in the drive letter) is accepted, but not sure if that's understood as a Windows path internally? Should I always remove the : in the drive?

Metadata

Metadata

Assignees

No one assigned

    Labels

    type::bugSomething isn't workingwhere::windowsWindows-specific issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions