<br><br><div><span class="gmail_quote">On 9/5/06, <b class="gmail_sendername">M.-A. Lemburg</b> <<a href="mailto:mal@egenix.com">mal@egenix.com</a>> 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>> On 9/4/06, Neal Norwitz <<a href="mailto:nnorwitz@gmail.com">nnorwitz@gmail.com</a>> wrote:<br>>><br>>> There are 3 bugs currently listed in PEP 356 as blocking:<br>>>
<a href="http://python.org/sf/1551432">http://python.org/sf/1551432</a> - __unicode__ breaks on exception<br>>> classes<br>><br>><br>> I replied on the bug report, but might as well comment here.<br>><br>
> The problem with this bug is that BaseException now defines a __unicode__()<br>> method in its PyMethodDef. That intercepts the unicode() call on the class<br>> and it complains it was not handed an instance. I guess the only way to
<br>> fix this is to toss out the __unicode__() method and change the tp_str function<br>> to return Unicode as needed (unless someone else has a better idea). Or<br>> 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 and what I said on the bug report. 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> </div><br></div>