[Twisted-Python] CopyableFailure fails

Wolfgang Rohdewald wolfgang at rohdewald.de
Mon Feb 6 15:07:25 EST 2012


Hi, 

with twisted 11.0.0 and python 2.7, my error fails here:

  File "/usr/local/lib/python2.7/dist-packages/Twisted-11.0.0-py2.7-linux-
x86_64.egg/twisted/spread/pb.py", line 407, in getStateToCopy
    state['value'] = str(self.value) # Exception instance
exceptions.UnicodeEncodeError: 'ascii' codec can't encode character u'\u201e' 
in position 10: ordinal not in range(128)

this bug hides my own bug, giving me no useful backtrace.

simple fix:

--- x   2012-02-06 21:05:33.907228573 +0100
+++ pb.py       2012-02-06 21:05:36.923228461 +0100
@@ -404,7 +404,7 @@
         if isinstance(self.value, failure.Failure):
             state['value'] = failure2Copyable(self.value, 
self.unsafeTracebacks)
         else:
-            state['value'] = str(self.value) # Exception instance
+            state['value'] = repr(self.value) # Exception instance
         if isinstance(self.type, str):
             state['type'] = self.type
         else:


-- 
Wolfgang



More information about the Twisted-Python mailing list