Ticket #4520 defect closed fixed
pb.CopiedFailure.throwExceptionIntoGenerator breaks in Python 2.6.
| Reported by: | sirgolan | Owned by: | exarkun |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | pb | Keywords: | |
| Cc: | Branch: | branches/copiedfailure-stringexc-4520 | |
| Author: | sirgolan, Koblaid, glyph | Launchpad Bug: |
Description
Since the exception type of a CopiedFailure is a string, in Python 2.6, it raises exceptions.TypeError: exceptions must be classes, or instances, not str when CopiedFailure.throwExceptionIntoGenerator is called.
Prior to Python 2.6, it only gave a DeprecationWarning about raising string exceptions.
I'm attaching a test that exposes the issue. When run in Python 2.6, it results in the following:
[ERROR]: twisted.test.test_pb.CopyableFailureTest.test_throwExceptionIntoGenerator
Traceback (most recent call last):
File "F:\Projects\Twisted\trunk\twisted\test\test_pb.py", line 1920, in test_throwExceptionIntoGenerator
copy.throwExceptionIntoGenerator(gen)
File "F:\Projects\Twisted\trunk\twisted\python\failure.py", line 348, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
exceptions.TypeError: exceptions must be classes, or instances, not str
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

