New issue 3 by hegel666: Impossible to store binary key and values
http://code.google.com/p/tokyo-python/issues/detail?id=3
What steps will reproduce the problem?
1. Run attached unit test
What version of the product are you using? On what operating system?
tokyo-python 0.6.0, tokyocabinet-1.4.45, debian 5.04 64bit
Please provide any additional information below.
tokyo-python uses tcbput2() family of functions instead of more versatile
tcbput() functions. tcbput2() accepts string keys and values and computes
their length using strlen() - as an effect it's impossible to store binary
data which may contain \0 byte. I didn't have this problem with
tokyocabinet-0.5.
Attachments:
test-binary.py 536 bytes
Comment #1 on issue 3 by lekmalek: Impossible to store binary key and values
http://code.google.com/p/tokyo-python/issues/detail?id=3
Well, now I feel dumb for not thinking about this.
Working on it, I'll get it fixed for 0.6.1 (I hope).
Thanks for the report
malek
Hi,
This issue should be fixed in trunk. Could you, please, test and report?
Thanks for your help
malek
Comment #3 on issue 3 by lekmalek: Impossible to store binary key and values
http://code.google.com/p/tokyo-python/issues/detail?id=3
I intend to release 0.6.1 in a week and a half (when I'm back from
vacations).
Can I consider this fixed or do you have any other problem with null bytes?
thanks for your help
malek
Thx for fixing, that's a big batch of changes!
All works fine for me now, but since I use binary 64-bit integers as keys,
I'm concerned with revision 38 and "keys must be without null bytes"
policy. I can't find such limitation in tokyo spec - is there a reason for
banning null bytes in keys?
My bad.
While testing with binary keys I discovered what I thought was a bug in
BDB.range(). Given that I was leaving for vacations, I took the
conservative approach of disabling null bytes in keys.
It turns out it was not a bug (and was not related to binary keys, anyway),
so r38 has been reverted in r44 and this issue should now be fixed (God! I
hope it is :-), I feel really dumb for overlooking it). Awaiting your
confirmation.
Again, thanks for your help and patience
malek
Comment #6 on issue 3 by lekmalek: Impossible to store binary key and values
http://code.google.com/p/tokyo-python/issues/detail?id=3
(No comment was entered for this change.)