473,289 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 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 1010

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Rami A. Kishek | last post by:
Hi - this mysterious behavior with shelve is just about to kill me. I hope someone here can shed some light. First of all, I have this piece of code which uses shelve to save instances of some...
1
by: Marc | last post by:
Hello all, I have searched and experimented but can't find a way to make this work. I have an application that I froze using py2exe which uses Shelve to store data for me. This is the error I am...
0
by: Michael Mulcahy | last post by:
Hi All, Problem: Shelve module doesn't like me OS: Win2000 version: 2.3.3 Here is simple reproduction code and the error that occurs: import shelve, anydbm
4
by: Terry Hancock | last post by:
I only just recently had a look at the shelve module, and it looks pretty handy, my only question being, what if I really want two shelves? Must I use two files? Also, it seems strange that...
5
by: Philippe C. Martin | last post by:
Hi, I just installed (compiled) Python 2.4.2 under Suse 10. The following code generates a seg error: import shelve print shelve.open ('test') I assume this has to do with the db behind...
4
by: softwindow | last post by:
according to the book instruduction , i use shelve Module to write record to file. i only write ten records like this: name sex age jim male 22 tom ...
1
by: brokow | last post by:
I have been trying to get the gdbm module in python 2.4 to read a gdbm file from python 1.5.2 and having no luck. I get a file error when I try to open the 1.5.2-created gdbm file. Even a very...
2
by: RayOsborn | last post by:
I have some old "shelve" databases created in Python 2.2 that use the old bsddb format, whereas the version of Python 2.4 installed by my web hosting service doesn't have bsddb available at all...
4
by: vshenoy | last post by:
Hi Guys, I was going through gdbm-1.8.3 source (http://ftp.gnu.org/gnu/gdbm/ gdbm-1.8.3.tar.gz) and found this strange thing : all the exposed functions of gdbm work with GDBM_FILE pointer...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.