-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Labels
Description
Description
When evaluating this package, I noticed that the pathname of an HTTPS address is output with a leading backslash, but for an SSH address without one, which means for my application that I have to check which protocol is used in order to edit the pathname if necessary.
My expectation would be that the pathname always returns the same regardless of the protocol (ideally without a leading backslash)
Steps to reproduce
The following code demonstrates the issue, the assertion is triggered, which proves the inconsistent API.
html_parse = giturlparse.parse("https://github.com/nephila/giturlparse.git")
ssh_parse = giturlparse.parse(html_parse.url2ssh)
assert ssh_parse.pathname == html_parse.pathname
Versions
Python 3.12.3
Expected behaviour
The pathname is always the same regardless of the protocol and the assertion is not triggered.
Actual behaviour
It does matter which URL is parsed, the assertion is triggered, which requires an additional processing step.