[issue3799] Byte/string inconsistencies between different dbm modules
Guido van Rossum
report at bugs.python.org
Wed Sep 10 16:13:29 CEST 2008
Guido van Rossum <guido at python.org> added the comment:
I think this isn't quite right.
Ideally a fix should maintain several important properties:
(1) Be able to read databases written by Python 2.x.
(1a) Write databases readable by Python 2.x.
(2) Use the same mapping between str and bytes as the other *dbm
libraries have.
(2a) Return the same value for keys() as the other *dbm libraries
(except for order).
I think (2) means that we should use UTF-8 to convert str keys to bytes,
but (1) means we should use Latin-1 to convert keys to str *upon writing
the index*. This will also satisfy (1a). The keys maintained
internally should be kept in bytes to satsfy (2a).
PS. I noticed the dbm module still returns bytearrays for keys and
values. Is there a bug open to change those to bytes?
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3799>
_______________________________________
More information about the Python-bugs-list
mailing list