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 skip.montanaro
Recipients barry, brett.cannon, christian.heimes, gvanrossum, jcea, skip.montanaro, vstinner
Date 2008-11-21.15:42:33
SpamBayes Score 3.778644e-13
Marked as misclassified No
Message-id <1227282155.95.0.888971712181.issue3799@psf.upfronthosting.co.za>
In-reply-to
Content
damn... my cc to report@bugs.python.org didn't work.  Here's the recap
(message to python-checkins):

    me> ... I thought Guido was of the opinion that the 3.0 version 
should
    me> be able to read dumb dbms written by earlier Python versions....

And write them.  From msg72963:

    (1) Be able to read databases written by Python 2.x.

    (1a) Write databases readable by Python 2.x.

Ah, but wait a minute.  I see your comment in msg76080:

    If you look at the 2.7 code all it requires of keys and values in
    __setitem__ is that they are strings; there is nothing about Latin-1 
in
    terms of specific encoding (must be a 3.0 addition to make the
    str/unicode transition the easiest).

The acid test.  I executed the attached mydb2write.py using Python 2.5 
then
executed the attached mydb3read.py using Python 3.0.  The output:

    % python2.5 mydb2write.py 
    1 abc
    2 [4, {4.2999999999999998: 12}]
    3 <__main__.C instance at 0x34bb70>
    % python3.0 mydb3read.py
    1 b'abc'
    2 [4, {4.2999999999999998: 12}]
    Traceback (most recent call last):
      File "mydb3read.py", line 13, in <module>
        print(3, pickle.loads(db['3']))
      File "/Users/skip/local/lib/python3.0/pickle.py", line 1329, in 
loads
        return Unpickler(file, encoding=encoding, errors=errors).load()
    _pickle.UnpicklingError: bad pickle data

so if the ability to read Python 2.x dumbdbm files is still a 
requirement I
think there's a little more work to do.
History
Date User Action Args
2008-11-21 15:42:36skip.montanarosetrecipients: + skip.montanaro, gvanrossum, barry, brett.cannon, jcea, vstinner, christian.heimes
2008-11-21 15:42:35skip.montanarosetmessageid: <1227282155.95.0.888971712181.issue3799@psf.upfronthosting.co.za>
2008-11-21 15:42:35skip.montanarolinkissue3799 messages
2008-11-21 15:42:33skip.montanarocreate