[Tutor] shelves behaving badly

Luke Jordan luke.jordan at gmail.com
Fri Jul 27 20:38:35 CEST 2007


i've implemented a database as a shelve of record class instances. some of
the fields in each record are dictionaries.

i needed to parse info from 3 different reports into the dictionary fields
in each record instance. i wrote the code to do this and tinkered it to fit
the different reports (i.e. information being in different columns, etc.).
for 2 of the reports, it runs fine. the required info turns up in the shelve
after i run the code, and i can exit and reenter python, open the shelve,
and it's all still there, where it should be. i've quadruple checked the
code for the third report, and it looks like it should work. in fact it
runs, and reports back that it did everything i told it to do; this includes
checking results as they occur at runtime. however, when i reopen the
shelve, none of that data is there. writeback is set to True, and I didn't
forget to close the shelve at the end of my code.

Now, if I open the shelve in the same shell as the script ran in, right
after I run it, I get the updated shelve. but any other method of opening
the shelve results in the shelve missing the data from the third report.

Any ideas what's going on here?

-- 
Luke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070727/7825acf0/attachment.htm 


More information about the Tutor mailing list