Problem with shelve/gdbm

Discussion in 'Python' started by Douglas Applegate, Oct 19, 2007.

  1. Hi-

    I am having a problem with shelve. The problem I think is really with
    gdbm. I'll write out a file using shelve/gdbm on an amd64 machine and
    then I'll try to read it in on a i386 machine. The result is a 'gdbm
    fatal: read error.' Reversing directions results in the same problem.
    Below are two small programs that get at the heart of the problem:

    #test.py##############
    #!/usr/bin/env python
    import gdbm
    print gdbm
    storage = gdbm.open('test.pstor', 'c')

    storage['test'] = 'a'

    storage.close()


    #test2.py#########
    #!/usr/bin/env python
    import gdbm
    print gdbm
    storage = gdbm.open('test.pstor', 'r')

    print storage['test']

    storage.close()

    #####################################
    The result of running test2 is as follows:

    <module 'gdbm' from '/---/software/python/lib/python2.5/lib-dynload/gdbm.so'>
    Traceback (most recent call last):
    File "./test2.py", line 4, in <module>
    storage = gdbm.open('test.pstor', 'r')
    gdbm fatal: read error



    It isn't much to go on, but has anybody else had this problem?


    Cheers,
    Doug
     
    Douglas Applegate, Oct 19, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bucket79
    Replies:
    1
    Views:
    760
    Arne Koewing
    Aug 21, 2003
  2. Ed
    Replies:
    1
    Views:
    521
  3. Laszlo Nagy

    gdbm objects not iterable?

    Laszlo Nagy, Oct 3, 2007, in forum: Python
    Replies:
    0
    Views:
    297
    Laszlo Nagy
    Oct 3, 2007
  4. Shriphani

    gdbm troubles.

    Shriphani, Oct 11, 2007, in forum: Python
    Replies:
    2
    Views:
    295
    Laszlo Nagy
    Oct 11, 2007
  5. Replies:
    2
    Views:
    313
Loading...

Share This Page