Michele Petrazzo  <[EMAIL PROTECTED]> wrote:
>Sion Arrowsmith wrote:
>> This is a documented behaviour of shelve:
> [ open(filename) may create files with names based on filename + ext ]
>(and I fail to understand why
>> it is a problem).
>Because:
>1) I pass a name that, after, I'll pass to another program and if shelve
>change the name, the latter can't read it (it doesn't exists!)

Hmm, is there any guarantee that the filename you give to shelve.open()
to create will correspond to a single file on disk that you can hand to
another application for purposes other than opening to read with shelve?
Given that it's documented that it may create other files, it seems to
me like you'd always want the other program to look for file and file.*
anyway. Unless it's just reading:

>2) I can't read those files with shelve! If I try... :
>
>>>> shelve.open("test.dat")
>Traceback (most recent call last):
> [ ... ]
>anydbm.error: db type could not be determined

Did you try opening using the filename you originally gave, ie
shelve.open("test")? Of course plain open("test") will fail, but
this is opening a dbm structure based on "test" not a simple file.

-- 
\S -- [EMAIL PROTECTED] -- http://www.chaos.org.uk/~sion/
  ___  |  "Frankly I have no feelings towards penguins one way or the other"
  \X/  |    -- Arthur C. Clarke
   her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to