Plone:TypeError:Can';t在采集包装器中pickle对象

Plone:TypeError:Can';t在采集包装器中pickle对象,plone,zope,Plone,Zope,我正在使用/修复collective.logbook来保存站点上的错误。目前,日志在我的网站上失败,但有一些例外情况: File "/srv/plone/xxx/src/collective.logbook/collective/logbook/events.py", line 101, in hand transaction.commit() File "/srv/plone/buildout-cache/eggs/transaction-1.1.1-py2.6.egg/tra

我正在使用/修复
collective.logbook
来保存站点上的错误。目前,日志在我的网站上失败,但有一些例外情况:

  File "/srv/plone/xxx/src/collective.logbook/collective/logbook/events.py", line 101, in hand
    transaction.commit()
  File "/srv/plone/buildout-cache/eggs/transaction-1.1.1-py2.6.egg/transaction/_manager.py", line 8
    return self.get().commit()
  File "/srv/plone/buildout-cache/eggs/transaction-1.1.1-py2.6.egg/transaction/_transaction.py", li
    self._commitResources()
  File "/srv/plone/buildout-cache/eggs/transaction-1.1.1-py2.6.egg/transaction/_transaction.py", li
    rm.commit(self)
  File "/srv/plone/buildout-cache/eggs/ZODB3-3.10.5-py2.6-linux-x86_64.egg/ZODB/Connection.py", lin
    self._commit(transaction)
  File "/srv/plone/buildout-cache/eggs/ZODB3-3.10.5-py2.6-linux-x86_64.egg/ZODB/Connection.py", lin
    self._store_objects(ObjectWriter(obj), transaction)
  File "/srv/plone/buildout-cache/eggs/ZODB3-3.10.5-py2.6-linux-x86_64.egg/ZODB/Connection.py", lin
    p = writer.serialize(obj)  # This calls __getstate__ of obj
  File "/srv/plone/buildout-cache/eggs/ZODB3-3.10.5-py2.6-linux-x86_64.egg/ZODB/serialize.py", line
    return self._dump(meta, obj.__getstate__())
  File "/srv/plone/buildout-cache/eggs/ZODB3-3.10.5-py2.6-linux-x86_64.egg/ZODB/serialize.py", line
    self._p.dump(state)
TypeError: Can't pickle objects in acquisition wrappers.
这显然是因为日志试图写一个错误记录,它涉及到一个获取的对象。我假设解决方案是清除这类对象的错误


但是,我如何才能找出坏对象是什么,它如何最终到达事务管理器,以及是什么Python对象引用导致了这个问题?或者任何可以帮助我调试这个问题的东西?

如果你能可靠地复制这个问题,你可以在ZODB连接
\u寄存器
方法(在
ZODB/connection.py
ZODB
鸡蛋中)中放入打印语句或
pdb.set_trace()


现在,每当任何对象被标记为已更改或作为新对象添加到连接中时,都会将其打印到控制台。这将有助于调试过程。祝你好运

这是否涉及读写对象?有没有办法只标记正在写入的对象?这应该只涉及已写入的对象;它们将在稍后提交的连接中注册。
def _register(self, obj=None):
    # ... skipped lines ...

    if obj is not None:
        self._registered_objects.append(obj)
        # Insert print statement here.