Message167550
| Author |
paulb |
| Recipients |
paulb |
| Date |
2012年08月06日.09:53:57 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1344246838.35.0.931540837367.issue15565@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
In Python 2.6, pdb doesn't show exception strings properly:
#somecode.py
import pdb
pdb.set_trace()
raise Exception('This is a message that contains a lot of characters and is very long indeed.')
#terminal
> somecode.py
-> raise Exception('This is a message that contains a lot of characters and is very long indeed.')
(Pdb) n
Exception: Exceptio...ndeed.',)
The pdb code assumes that sys.exc_info()[1] is a string. In fact it's an Exception instance.
The solution I found was to use str()
#pdb.py line 186
print >>self.stdout, exc_type_name + ':', _saferepr(str(exc_value))
This may have been fixed already but I couldn't find any reference to it. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年08月06日 09:53:58 | paulb | set | recipients:
+ paulb |
| 2012年08月06日 09:53:58 | paulb | set | messageid: <1344246838.35.0.931540837367.issue15565@psf.upfronthosting.co.za> |
| 2012年08月06日 09:53:57 | paulb | link | issue15565 messages |
| 2012年08月06日 09:53:57 | paulb | create |
|