Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot parse github url #43

Closed
nasifimtiazohi opened this issue Nov 18, 2021 · 3 comments · Fixed by #53
Closed

cannot parse github url #43

nasifimtiazohi opened this issue Nov 18, 2021 · 3 comments · Fixed by #53

Comments

@nasifimtiazohi
Copy link

nasifimtiazohi commented Nov 18, 2021

fails to parse 'https://github.com/rubygems/rubygems/'. The issue arises from having a / character at the end.

>>> from giturlparse import parse
>>> s = 'https://github.com/rubygems/rubygems/'
>>> p = parse(s)
>>> p.host
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/nasifimtiaz/Library/Caches/pypoetry/virtualenvs/package-locator-2SDQOXag-py3.9/lib/python3.9/site-packages/giturlparse/result.py", line 43, in host
    return self.domain
AttributeError: 'GitUrlParsed' object has no attribute 'domain'
>>> p.owner
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'GitUrlParsed' object has no attribute 'owner'
@alingse
Copy link

alingse commented Jan 30, 2022

+1 see this should strip the last /
@yakky

if you like, I can make an pull request for this.

@davidjray
Copy link

Seeing a similar error AttributeError: 'GitUrlParsed' object has no attribute '_platform_obj'

Removing the trailing slash resolved the issue for me.

@yakky yakky mentioned this issue Apr 25, 2023
2 tasks
@yakky
Copy link
Member

yakky commented Apr 25, 2023

Thanks @davidjray @alingse @nasifimtiazohi for reporting this. It has been fixed by an unrelated PR, but I added this case in #53 to guard against regressions

@yakky yakky closed this as completed in #53 Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants