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

Different behavior of captureWarnings between python 3.14.3 and 3.14.3t #146358

Open
Labels
3.14bugs and security fixes3.15new features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)topic-free-threadingtype-bugAn unexpected behavior, bug, or error
@abulgher

Description

@abulgher

Bug report

Bug description:

Consider the following code snippet as a MWE

importloggingimportwarningsdefemit_user_warning()->None:"""Trigger the warning that we expect pytest-style helpers to see."""warnings.warn('MWE warning',UserWarning)defmain()->None:"""Log the warning while capturing it via ``warnings.catch_warnings``."""logging.captureWarnings(True)warnings.simplefilter('always',UserWarning)withwarnings.catch_warnings(record=True)asrecorded:emit_user_warning()print('warnings captured inside catch_warnings:',len(recorded))forentryinrecorded:print('  captured message:',entry.message)if__name__=='__main__':main()

Executing this script with python3.14 will generate the following output:

$`uv python find 3.14` nogil_warning_capture.py warnings captured inside catch_warnings: 1  captured message: MWE warning

while the output on python3.14t will be:

$ `uv python find 3.14t` nogil_warning_capture.py warnings captured inside catch_warnings: 0

I am actually expecting the behavior of 3.14 to be the correct one.

CPython versions tested on:

3.14

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.14bugs and security fixes3.15new features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)topic-free-threadingtype-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-2026 Movatter.jp