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

Pattern matching does not match redis behaviour #182

Closed
bmerry opened this issue Mar 23, 2018 · 0 comments
Closed

Pattern matching does not match redis behaviour #182

bmerry opened this issue Mar 23, 2018 · 0 comments
Assignees

Comments

@bmerry
Copy link
Collaborator

bmerry commented Mar 23, 2018

The implementation of KEYS and SCAN uses fnmatch.fnmatch to match the pattern. This has a few problems:

  • At a minimum it should use fnmatchcase to avoid being case-insensitive on some OSes.
  • It does not support backslash escapes.
  • It uses ! instead of ^ for negated
  • It seems to handle invalid ranges like [e-a] differently (raises an exception, whereas redis does something unspecified I still need to work out).

It also operates by turning both arguments into native strings using the system default encoding, even though they might not be valid in that encoding.

bmerry added a commit that referenced this issue Apr 2, 2018
This matches the quirks in the redis pattern matching, which has some
differences from fnmatch. It also applies all the logic in bytes, rather
than the native character encoding.

Fixes #182.
@bmerry bmerry self-assigned this Apr 2, 2018
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

No branches or pull requests

1 participant