classification
Title: Tracebacks are not properly indented
Type: Stage:
Components: Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: amaury.forgeotdarc, brett.cannon
Priority: normal Keywords: patch

Created on 2008-07-11 12:03 by amaury.forgeotdarc, last changed 2008-07-11 21:49 by brett.cannon. This issue is now closed.

Files
File name Uploaded Description Edit
traceback.patch amaury.forgeotdarc, 2008-07-11 12:03
Messages (5)
msg69546 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-07-11 12:03
r62555 has the unfortunate effect that source lines are no more indented
in tracebacks, as in:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\python\trunk\lib\re.py", line 150, in sub
return _compile(pattern, 0).sub(repl, string, count)
  File "C:\python\trunk\lib\re.py", line 276, in filter
return sre_parse.expand_template(template, match)
  File "c:\python\trunk\lib\sre_parse.py", line 793, in expand_template
raise error, "unmatched group"
sre_constants.error: unmatched group

And IMO, test_traceback.test_traceback_indentation() tests the wrong
behaviour :-(
I join a tentative patch to correct the problem.
msg69555 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2008-07-11 16:34
I really hate how touchy the indentation output is for warnings/tracebacks.
msg69557 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-07-11 16:37
This is why I added an explicit "indent" parameter to Py_DisplaySourceLine.
msg69566 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-07-11 21:46
Corrected as r64881.
msg69567 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2008-07-11 21:49
Thanks for fixing this and renaming the function, Amaury!

On Fri, Jul 11, 2008 at 2:46 PM, Amaury Forgeot d'Arc
<report@bugs.python.org> wrote:
>
> Amaury Forgeot d'Arc <amauryfa@gmail.com> added the comment:
>
> Corrected as r64881.
>
> ----------
> resolution:  -> fixed
> status: open -> closed
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue3342>
> _______________________________________
>
History
Date User Action Args
2008-07-11 21:49:44brett.cannonsetmessages: + msg69567
2008-07-11 21:46:48amaury.forgeotdarcsetstatus: open -> closed
resolution: fixed
messages: + msg69566
2008-07-11 16:38:15brett.cannonsetassignee: brett.cannon
2008-07-11 16:37:24amaury.forgeotdarcsetmessages: + msg69557
2008-07-11 16:34:55brett.cannonsetmessages: + msg69555
2008-07-11 16:34:16brett.cannonsetnosy: + brett.cannon
2008-07-11 12:03:11amaury.forgeotdarccreate