[Zope-dev] POSKeyError how to remove

Jim Fulton jim at zope.com
Thu Jul 23 07:15:35 EDT 2009


The object is already gone. It's odd that it is in the index.
You can try deleting the object from the index and then saving the
index.  You might need to use ZODB 3.9 to do that, as I think __del__
was only recently added to file-storage indexes.

Jim

On Thu, Jul 23, 2009 at 6:57 AM, Rupesh P Raj<roopesh.praj at gmail.com> wrote:
> Hi,
>
> Using Zope Debug Console, I used a part of the code fsrefs.py to find the
> oid's of POSKeyError:
>
>     fs = FileStorage(path, read_only=1)
>     undone = {}
>
>     noload = {}
>
>     for oid in fs._index.keys():
>         try:
>             data, serial = fs.load(oid, "")
>         except (KeyboardInterrupt, SystemExit):
>             raise
>         except POSKeyError:
>             undone[oid] = 1
>         except:
>             if VERBOSE:
>                 traceback.print_exc()
>             noload[oid] = 1
>
> This gave me one oid.Then I tried something like below :
>
> obj = app._p_jar[oid]
>
> But this gave me another POSKeyError instead :(
>
> Why does this happen? How can I delete this object.
>
> Thanks,
> Roopesh
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev at zope.org
> http://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope )
>
>



-- 
Jim Fulton


More information about the Zope-Dev mailing list