[Python-Dev] Traceback style

bwarsaw@python.org bwarsaw@python.org
Tue, 2 May 2000 13:51:17 -0400 (EDT)


>>>>> "GvR" == Guido van Rossum <guido@python.org> writes:

    GvR> For regular files I'd leave the formatting alone -- there are
    GvR> tools out there that parse these.  (E.g. Emacs' Python mode
    GvR> jumps to the line with the error if you run a file and it
    GvR> begets an exception.)

py-traceback-line-re is what matches those lines.  It's current
definition is

(defconst py-traceback-line-re
  "[ \t]+File \"\\([^\"]+\\)\", line \\([0-9]+\\)"
  "Regular expression that describes tracebacks.")

There are probably also gud.el (and maybe compile.el) regexps that
need to be changed too.  I'd rather see something that outputs the
same regardless of whether it's a real file, or something "fake".
Something like

Line 1 of <stdin>
Line 12 of foo.py

should be fine.  I'm not crazy about something like

File "foo.py", line 12
In <stdin>, line 1

-Barry