PyWart: Exception error paths far too verbose

Terry Reedy tjreedy at udel.edu
Wed Jan 16 19:51:31 EST 2013


On 1/16/2013 11:43 AM, Rick Johnson wrote:
> On Wednesday, January 16, 2013 3:53:55 AM UTC-6, Terry Reedy wrote:
>
>> I agree with the complaint and you may have the germ of a good
>> idea. The problem is that for some tracebacks, paths jump all over
>> the place rather than having a common prefix. Dealing with this
>> might require preprocessing the entire traceback before iterating
>> and printing each item.
>
> Your comment is too ambiguous for me to comprehend... Are you
> referring to the case where devs keep python modules and scripts in
> /many/ places on their disc, or something else?

I missed in your original post that you only want one consistent 
personal library path abbreviated, leaving everything else alone. So the 
above is not applicable. And a custom excepthook very easy.

How should the traceback mechanism will know what that path is?

To answer the objection about having to search the whole disk when on a 
'foreign' machine, the top line of the traceback could be

Traceback: ... = C:/users/me/pystuff

>> The only thing special that IDLE does now is to color the text red.
>> I should sometime see how that is done. (Being able to doubleclick
>> on an item and have IDLE open an edit window at the specified line
>> would be really nice!)
>
> IDLE already has a build in command from the context menu called "go
> to file/line" that will parse any right-clicked line for file paths
> and line numbers, then, open that file in a new IDLE editor instance
> and adjust the view so you can see the lineno in question (typical
> IDE stuff)...

I never noticed that. Thanks for the exchange of information.

-- 
Terry Jan Reedy




More information about the Python-list mailing list