[Zope3-Users] Direct ZODB access in a Zope3 instance

Brad Allen brad at allendev.com
Wed Nov 30 14:02:12 EST 2005


Based on discussion in the 'need guidance' thread, I started looking into
how to access the Zope ZODB directly from within Python scripts.
I haven't gotten very far yet. I'm still at the beginning of the docs at
<http://www.zope.org/Wikis/ZODB/FrontPage/guide/zodb.html>
trying out the example code.

I got stuck trying to open the Data.fs file in my Zope instance.

Python 2.4.2 (#2, Sep 30 2005, 21:19:01)
[GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>  from ZODB import FileStorage, DB
>>>  storage = FileStorage.FileStorage('Data.fs')
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File 
"/usr/lib/python2.4/site-packages/ZODB/FileStorage/FileStorage.py", 
line 112, in __init__
     self._lock_file = LockFile(file_name + '.lock')
   File "/usr/lib/python2.4/site-packages/ZODB/lock_file.py", line 57, 
in __init__
     self._fp = open(path, 'r+')
IOError: [Errno 13] Permission denied: 'Data.fs.lock'
>>>  storage = FileStorage.FileStorage('Data.fs')

I tried shutting down the Zope 3 instance, the the same traceback 
appeared anyway.

I checked to make sure I had the filename right:

>>>  import os
>>>  os.path.isfile('Data.fs')
True


How do I clear the lock on the file?

Thanks!




More information about the Zope3-users mailing list