--On 7. Januar 2008 18:29:50 +0000 Peter Bengtsson <[EMAIL PROTECTED]> wrote:

My code works fine in normal running zope but not when run as a testcase
(I'm not using bin/zopectl test if that matters) I get the following
I feel guilty since I've got this line in my code:
transaction.get().commit()  (Expense.py#4458)

I remember having come across this error before but can't remember what
the solution was.

Traceback (most recent call last):
line 98, in __call__
   File "testExpenses2.py", line 81, in test_uploadPhotos
     eids = context.uploadExpenseFiles(files)
   File "/home/peterbe/zope/zope285/Products/MExpenses/Expense.py", line
4458, in uploadExpenseFiles
   File "lib/python/transaction/_transaction.py", line 381, in commit
   File "lib/python/transaction/_transaction.py", line 379, in commit
   File "lib/python/transaction/_transaction.py", line 424, in
   File "/home/peterbe/zope/zope285/lib/python/ZODB/Connection.py", line
462, in commit
   File "/home/peterbe/zope/zope285/lib/python/ZODB/Connection.py", line
503, in _commit
     self._store_objects(ObjectWriter(obj), transaction)
   File "/home/peterbe/zope/zope285/lib/python/ZODB/Connection.py", line
525, in _store_objects
     p = writer.serialize(obj)  # This calls __getstate__ of obj
   File "/home/peterbe/zope/zope285/lib/python/ZODB/serialize.py", line
330, in serialize
     return self._dump(meta, obj.__getstate__())
   File "/home/peterbe/zope/zope285/lib/python/ZODB/serialize.py", line
339, in _dump
   File "copy_reg.py", line 69, in _reduce_ex
     raise TypeError, "can't pickle %s objects" % base.__name__
TypeError: can't pickle instancemethod objects

Well, this error is self-speaking :-)

The standard solution for figuring out the related property/attr keeping the instancemethod is: pdb. Look at the object or its __dict__ and check what is inside or think about your code where you might be assigning a method somewhere.


Attachment: pgpV74RHTM3KV.pgp
Description: PGP signature

Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to