Skip to content

Beginning of a path starting with a number gets parsed as a port number for SSH #131

@extrwi

Description

@extrwi

Description

Organization names / paths starting with numbers don't get parsed correctly, when a colon is used as a separator between hostname and path, e.g. in SSH URLs like git@foo:1337org/path.git

Steps to reproduce

import giturlparse
giturlparse.parse("git@example.com:123org/repo.git").urls

Versions

  • Python 3.13.7
  • giturlparse 0.14.0

Expected behaviour

{'https': 'https://example.com/123org/repo.git', 'ssh': 'git@example.com:123org/repo.git', 'git': 'git://example.com/123org/repo.git'}

Actual behaviour

{'https': 'https://example.com/org/repo.git', 'ssh': 'git@example.com:123/org/repo.git', 'git': 'git://example.com123/org/repo.git'}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions