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

Filter Fix #690

Merged
merged 2 commits into from Feb 10, 2022
Merged

Filter Fix #690

merged 2 commits into from Feb 10, 2022

Conversation

corubba
Copy link
Contributor

@corubba corubba commented Feb 9, 2022

The filter was broken since the Python v2->v3 migration because the name of the method for boolean evaluation changed, and as a result of that the parsed filter expression wasn't properly evaluated but always returned true for any input.

Also fixed a small related issue where un-parsable inputs resulted in a crash. These are now caught and fallback to the simple string search.

Fixes #638 and #665.

What `__bool__` is in python v3 was `__nonzero__` in python v2. By
renaming these methods, the truth evaluation of the parsed expression
in line 204 works again.

fixes puddletag#638
When the parser fails to parse the given filter expression, fall back
to the simple string based filter.

Fixes puddletag#665
@sandrotosi sandrotosi merged commit c384d20 into puddletag:master Feb 10, 2022
@corubba corubba deleted the bugfix/filter branch February 10, 2022 04:12
@corubba corubba linked an issue Feb 18, 2022 that may be closed by this pull request
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.

Crash when trying to filter non alphabetical characters Filter Expressions stopped working
2 participants