Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

traceback.print_last behaving differently across python versions #130250

Closed
Assignees
iritkatriel
Labels
3.12only security fixes3.13bugs and security fixes3.14bugs and security fixestype-bugAn unexpected behavior, bug, or error
@mironleon

Description

@mironleon

Bug report

Bug description:

traceback.print_last() correctly prints the latest traceback for python 3.10.16 and 3.11.9, but it printsNoneType: None for 3.12.9 and 3.13.2

See alsoipython/ipython#14744, I originally thought it was an ipython issue

Python 3.10.16 (main, Feb 13 2025, 14:32:36) [GCC 11.4.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>> 1/0Traceback (most recent call last):  File "<stdin>", line 1, in <module>ZeroDivisionError: division by zero>>> import traceback>>> traceback.print_last()Traceback (most recent call last):  File "<stdin>", line 1, in <module>ZeroDivisionError: division by zero
Python 3.11.9 (main, Feb 13 2025, 14:34:41) [GCC 11.4.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>> 1/0Traceback (most recent call last):  File "<stdin>", line 1, in <module>ZeroDivisionError: division by zero>>> import traceback>>> traceback.print_last()Traceback (most recent call last):  File "<stdin>", line 1, in <module>ZeroDivisionError: division by zero
Python 3.12.9 (main, Feb 13 2025, 13:23:03) [GCC 11.4.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>> 1/0Traceback (most recent call last):  File "<stdin>", line 1, in <module>ZeroDivisionError: division by zero>>> import traceback>>> traceback.print_last()NoneType: None
Python 3.13.2 (main, Feb 13 2025, 11:10:27) [GCC 11.4.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>> 1/0Traceback (most recent call last):  File "<python-input-0>", line 1, in <module>    1/0    ~^~ZeroDivisionError: division by zero>>> import traceback>>> traceback.print_last()NoneType: None

CPython versions tested on:

3.10, 3.11, 3.12, 3.13

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

Labels

3.12only security fixes3.13bugs and security fixes3.14bugs and security fixestype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp