Q: shelve ovewrites for different users

Erno Kuusela erno-news at erno.iki.fi
Sun Feb 4 13:46:37 EST 2001


In article <lxk1ytev19i.fsf at ioasun3.epfl.ch>, Jan Kybic
<Jan.Kybic at epfl.ch> writes:

| I am sharing the shelve file between two users on Unix.

are your two different users reading and writing it at the
same time? if so, problems are to be expected. you
need to either

1) set up locking manually, there are some functions
   in the fcntl module to do that, or

2) use gdbm for the shelf object (gdbm does locking itself): copy the
   DbfilenameShelf class from shelve.py and change "anydbm" to "gdbm".

  -- erno



More information about the Python-list mailing list