471,313 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,313 software developers and data experts.

Problem with shelve/gdbm

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
Oct 19 '07 #1
0 944

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Rami A. Kishek | last post: by
1 post views Thread by Marc | last post: by
reply views Thread by Michael Mulcahy | last post: by
4 posts views Thread by Terry Hancock | last post: by
5 posts views Thread by Philippe C. Martin | last post: by
4 posts views Thread by softwindow | last post: by
2 posts views Thread by RayOsborn | last post: by
4 posts views Thread by vshenoy | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.