This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gvanrossum
Recipients gvanrossum, skip.montanaro
Date 2008-09-10.14:12:39
SpamBayes Score 5.0944336e-06
Marked as misclassified No
Message-id <1221056009.63.0.345620336287.issue3799@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2008-09-10 14:13:29gvanrossumsetrecipients: + gvanrossum, skip.montanaro
2008-09-10 14:13:29gvanrossumsetmessageid: <1221056009.63.0.345620336287.issue3799@psf.upfronthosting.co.za>
2008-09-10 14:12:40gvanrossumlinkissue3799 messages
2008-09-10 14:12:40gvanrossumcreate