Skip to content

Different behavior between repo.remote().url and repo.remote().urls when dealing with UNC paths #1019

Open
@HudsonMC16

Description

@HudsonMC16

Not sure if this is specifically realted to UNC paths or not, but here is what I'm observing.

Clone a repo from a networked server to your local machine. Then:

>>> from Pathlib import Path
>>> path_str = local_repo.remote('origin').url
>>> print(path_str)
'\\\\\\\\network\\\\path\\\\to\\\\remote\\\\repo'
>>> Path(path_str).exists()
False
>>> Path(path_str).resolve()
WindowsPath('C:/network/path/to/remote/repo')

whereas:

>>> from pathlib import Path
>>> path_str = next(local_repo.remote('origin').urls)
>>> print(path_str)
'\\\\network\\path\\to\\remote\\repo'
>>> Path(path_str).exists()
True
>>> Path(path_str).resolve()
WindowsPath('//network/path/to/remote/repo')

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions