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

Fix gnebbia/kb#83 #89

Merged
merged 1 commit into from
Jun 21, 2021
Merged

Fix gnebbia/kb#83 #89

merged 1 commit into from
Jun 21, 2021

Conversation

prokaryont
Copy link

Fix problem with spaces in artifact title when using grep command.

What does this implement/fix? Explain your changes.

This fixes the issue #83 of the grep command crashing with an IndexError when artifact titles contain spaces. If an artifact's title contains spaces get_file_name_wo_prefix() parses the artifact title incorrectly.

The following call to db_get_artifacts_by_filter() returns no results because all but the last parts of the title are incorporated into the category parameter. When the code tries to extract the (non-existen) result, an index error is raised.

A detailed description of the issue can be found here

The fix uses the standard library class pathlib.Path for prefix removal and parsing of path components.

Does this close any currently open issues?

It is supposed to fix #83.

Any relevant logs, error output, etc?

...

Any other comments?

...

Where has this been tested?

Operating System: linux, ubuntu 18.04

Platform: x86_64

Target Platform: x86_64/windows

Fix problem with spaces in artifact title when using grep command.
@gnebbia gnebbia merged commit 77629b6 into gnebbia:main Jun 21, 2021
@github-pages github-pages bot temporarily deployed to github-pages June 21, 2021 07:11 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kb grep "IndexError: list index out of range"
2 participants