<br><br><div><span class="gmail_quote">On 9/5/06, <b class="gmail_sendername">M.-A. Lemburg</b> &lt;<a href="mailto:mal@egenix.com">mal@egenix.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Brett Cannon wrote:<br>&gt; On 9/4/06, Neal Norwitz &lt;<a href="mailto:nnorwitz@gmail.com">nnorwitz@gmail.com</a>&gt; wrote:<br>&gt;&gt;<br>&gt;&gt; There are 3 bugs currently listed in PEP 356 as blocking:<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<a href="http://python.org/sf/1551432">http://python.org/sf/1551432</a> - __unicode__ breaks on exception<br>&gt;&gt; classes<br>&gt;<br>&gt;<br>&gt; I replied on the bug report, but might as well comment here.<br>&gt;<br>
&gt; The problem with this bug is that BaseException now defines a __unicode__()<br>&gt; method in its PyMethodDef.&nbsp;&nbsp;That intercepts the unicode() call on the class<br>&gt; and it complains it was not handed an instance.&nbsp;&nbsp;I guess the only way to
<br>&gt; fix this is to toss out the __unicode__() method and change the tp_str function<br>&gt; to return Unicode as needed (unless someone else has a better idea).&nbsp;&nbsp;Or<br>&gt; the bug can be closed as Won't Fix.<br><br>
The proper fix would be to introduce a tp_unicode slot and let<br>this decide what to do, ie. call .__unicode__() methods on instances<br>and use the .__name__ on classes.</blockquote><div><br>That was my bug reaction&nbsp; and what I said on the bug report.&nbsp; Kind of surprised one doesn't already exist.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I think this would be the right way to go for Python 2.6. For<br>Python 2.5, just dropping this .__unicode__ method on exceptions
<br>is probably the right thing to do.</blockquote><div><br>Neal, do you want to rip it out or should I?<br></div><br>-Brett<br><div>&nbsp;</div><br></div>