ztane / python-Levenshtein

The Levenshtein Python C extension module contains functions for fast computation of Levenshtein distance and string similarity
GNU General Public License v2.0
1.26k stars 155 forks source link

invalid input does not properly throw exceptions in all cases #69

Closed maxbachmann closed 3 years ago

maxbachmann commented 3 years ago

Some of the API's do not properly throw exceptions on invalid input. Instead they simply return NULL.

>>> Levenshtein.matching_blocks(None, None, None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SystemError: <built-in function matching_blocks> returned NULL without setting an error
maxbachmann commented 3 years ago

Fixed in https://github.com/maxbachmann/Levenshtein