Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Incorrect unicode behavior #1

Closed
shadwstalkr opened this issue Nov 9, 2009 · 1 comment
Closed

Incorrect unicode behavior #1

shadwstalkr opened this issue Nov 9, 2009 · 1 comment

Comments

@shadwstalkr
Copy link

In pybloom.py line 71 should test if the key is unicode rather than testing if the key is not unicode. If the key is not unicode, encoding it as utf-8 will first attempt to decode the string using the default encoding. Usually this is ascii, so if the string is not ascii a UnicodeDecodeError will be raised. Similarly, if the key is unicode, str(key) tries to encode the key in the default encoding. If the key contains non-ascii characters, this will raise UnicodeEncodeError.

@jaybaird
Copy link
Owner

This is now fixed in trunk. Thanks to Alex Brasetvik for the patch.

groovecoder pushed a commit to groovecoder/python-bloomfilter that referenced this issue Apr 10, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants