Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracebacks are not properly indented #47592

Closed
amauryfa opened this issue Jul 11, 2008 · 5 comments
Closed

Tracebacks are not properly indented #47592

amauryfa opened this issue Jul 11, 2008 · 5 comments
Assignees

Comments

@amauryfa
Copy link
Member

BPO 3342
Nosy @brettcannon, @amauryfa
Files
  • traceback.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/brettcannon'
    closed_at = <Date 2008-07-11.21:46:48.631>
    created_at = <Date 2008-07-11.12:03:11.240>
    labels = []
    title = 'Tracebacks are not properly indented'
    updated_at = <Date 2008-07-11.21:49:44.523>
    user = 'https://github.com/amauryfa'

    bugs.python.org fields:

    activity = <Date 2008-07-11.21:49:44.523>
    actor = 'brett.cannon'
    assignee = 'brett.cannon'
    closed = True
    closed_date = <Date 2008-07-11.21:46:48.631>
    closer = 'amaury.forgeotdarc'
    components = []
    creation = <Date 2008-07-11.12:03:11.240>
    creator = 'amaury.forgeotdarc'
    dependencies = []
    files = ['10877']
    hgrepos = []
    issue_num = 3342
    keywords = ['patch']
    message_count = 5.0
    messages = ['69546', '69555', '69557', '69566', '69567']
    nosy_count = 2.0
    nosy_names = ['brett.cannon', 'amaury.forgeotdarc']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue3342'
    versions = []

    @amauryfa
    Copy link
    Member Author

    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.

    @brettcannon
    Copy link
    Member

    I really hate how touchy the indentation output is for warnings/tracebacks.

    @amauryfa
    Copy link
    Member Author

    This is why I added an explicit "indent" parameter to Py_DisplaySourceLine.

    @brettcannon brettcannon self-assigned this Jul 11, 2008
    @amauryfa
    Copy link
    Member Author

    Corrected as r64881.

    @brettcannon
    Copy link
    Member

    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\>


    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants