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

Improper KeyError #55

Open
Madwand99 opened this issue Oct 22, 2018 · 0 comments
Open

Improper KeyError #55

Madwand99 opened this issue Oct 22, 2018 · 0 comments

Comments

@Madwand99
Copy link

Madwand99 commented Oct 22, 2018

This code results in an error:

import datrie
from struct import *

ascii=[pack('B',x).decode('latin-1') for x in range(256)]
t=datrie.Trie(ascii)
oneskey=''.join([ascii[x] for x in [255,139,234,21,94,4,210,70]])
t[oneskey]=5
t[oneskey]

Traceback (most recent call last):
File "datriefail.py", line 8, in
t[oneskey]
File "src/datrie.pyx", line 677, in datrie.Trie.getitem (src/datrie.c:12741)
File "src/datrie.pyx", line 192, in datrie.BaseTrie._getitem (src/datrie.c:4958)
KeyError: 'ÿ\x8bê\x15^\x04ÒF'

I can't figure out why it's causing a problem.

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