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

Bugs in PyTraceBack_Print() #76130

Closed
serhiy-storchaka opened this issue Nov 5, 2017 · 4 comments
Closed

Bugs in PyTraceBack_Print() #76130

serhiy-storchaka opened this issue Nov 5, 2017 · 4 comments
Assignees
Labels
3.7 (EOL) end of life interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

BPO 31949
Nosy @tiran, @berkerpeksag, @serhiy-storchaka
PRs
  • bpo-31949: Fixed several issues in printing tracebacks (PyTraceBack_Print()). #4289
  • [3.6] bpo-31949: Fixed several issues in printing tracebacks (PyTraceBack_Print()). (GH-4289) #4406
  • 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/serhiy-storchaka'
    closed_at = <Date 2017-11-15.16:05:18.089>
    created_at = <Date 2017-11-05.14:06:35.003>
    labels = ['interpreter-core', 'type-bug', '3.7']
    title = 'Bugs in PyTraceBack_Print()'
    updated_at = <Date 2018-09-22.19:12:11.434>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2018-09-22.19:12:11.434>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2017-11-15.16:05:18.089>
    closer = 'serhiy.storchaka'
    components = ['Interpreter Core']
    creation = <Date 2017-11-05.14:06:35.003>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 31949
    keywords = ['patch']
    message_count = 4.0
    messages = ['305595', '305596', '306274', '306280']
    nosy_count = 3.0
    nosy_names = ['christian.heimes', 'berker.peksag', 'serhiy.storchaka']
    pr_nums = ['4289', '4406']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue31949'
    versions = ['Python 3.6', 'Python 3.7']

    @serhiy-storchaka
    Copy link
    Member Author

    0fbab7f changed the semantic of PyTraceBack_Print and sys.tracebacklimit. It no longer match the documentation and the behavior of the traceback module. Setting sys.tracebacklimit to 0 or less no longer suppress printing tracebacks in PyTraceBack_Print(). Setting sys.tracebacklimit to None (as at shutdown stage) no longer makes PyTraceBack_Print() using default limit, but suppress printing tracebacks and sets a TypeError without returning failure from PyTraceBack_Print().

    The proposed PR restores the initial purposed semantic and fixes several other bugs in PyTraceBack_Print().

    • Setting sys.tracebacklimit to 0 or less now suppress printing tracebacks.
    • Setting sys.tracebacklimit to None now causes using the default limit.
    • Setting sys.tracebacklimit to an integer larger than LONG_MAX now means using the limit LONG_MAX rather than the default limit.
    • Fixed integer overflows in the case of more than 2**31 items on Windows.
    • Fixed output errors handling.

    @serhiy-storchaka serhiy-storchaka added the 3.7 (EOL) end of life label Nov 5, 2017
    @serhiy-storchaka serhiy-storchaka self-assigned this Nov 5, 2017
    @serhiy-storchaka serhiy-storchaka added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Nov 5, 2017
    @berkerpeksag
    Copy link
    Member

    Setting sys.tracebacklimit to 0 or less no longer suppress printing
    tracebacks in PyTraceBack_Print().

    This was also reported in bpo-12276.

    @serhiy-storchaka
    Copy link
    Member Author

    New changeset edad8ee by Serhiy Storchaka in branch 'master':
    bpo-31949: Fixed several issues in printing tracebacks (PyTraceBack_Print()). (bpo-4289)
    edad8ee

    @serhiy-storchaka
    Copy link
    Member Author

    New changeset 3864248 by Serhiy Storchaka in branch '3.6':
    [3.6] bpo-31949: Fixed several issues in printing tracebacks (PyTraceBack_Print()). (GH-4289) (bpo-4406)
    3864248

    @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
    3.7 (EOL) end of life interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants