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

AttributeError: when repo_url.is_fork called as repo_url can return NoneType #698

Closed
daeisbae opened this issue Apr 8, 2022 · 0 comments · Fixed by #705
Closed

AttributeError: when repo_url.is_fork called as repo_url can return NoneType #698

daeisbae opened this issue Apr 8, 2022 · 0 comments · Fixed by #705
Assignees
Labels
kind/bug Something isn't working.

Comments

@daeisbae
Copy link

daeisbae commented Apr 8, 2022

def get_project_from_url(self, url: str) -> "PagureProject":

def parse_git_repo(potential_url: str) -> Optional[RepoUrl]:

"parse_git_repo" function's return value is returned to repo_url variable which is used by "get_project_from_url" function, however "parse_git_repo" function can return NoneType causing AttributeError

@mfocko mfocko added the kind/bug Something isn't working. label Apr 27, 2022
@mfocko mfocko self-assigned this Apr 27, 2022
mfocko added a commit to mfocko/ogr that referenced this issue Apr 27, 2022
When using `PagureService.get_project_from_url` test for correctly parsed
URL before accessing its attributes (resulting in `AttributeError`).

Fixes packit#698

Signed-off-by: Matej Focko <[email protected]>
softwarefactory-project-zuul bot added a commit that referenced this issue Apr 27, 2022
fix(pagure): raise for invalid URL in pagure

When using PagureService.get_project_from_url test for correctly parsed
URL before accessing its attributes (resulting in AttributeError).
Fixes #698
Signed-off-by: Matej Focko [email protected]
RELEASE NOTES BEGIN
ogr now correctly raises OgrException when given invalid URL to PagureService.get_project_from_url.
RELEASE NOTES END

Reviewed-by: Jiri Popelka <None>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants