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

gh-135427: Fix DeprecationWarning for os.fork when run in threads with -Werror#136796

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
rani-pinchuk wants to merge5 commits intopython:main
base:main
Choose a base branch
Loading
fromrani-pinchuk:fix-issue-135427

Conversation

rani-pinchuk
Copy link

@rani-pinchukrani-pinchuk commentedJul 19, 2025
edited by bedevere-appbot
Loading

This is a small fix as suggested in#135427 - usingPyErr_WriteUnraisable() instead ofPyErr_Clear().

The fix includes a test which checks that theDeprecationWarning is provided when usingfork orforkpty within a thread, also when running with-Werror.

@encukou

@python-cla-bot
Copy link

python-cla-botbot commentedJul 19, 2025
edited
Loading

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app
Copy link

Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply theskip news label instead.

@bedevere-app
Copy link

Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply theskip news label instead.

@rani-pinchuk
Copy link
Author

I have created a NEWS entry for this fix, but actually this change has indeed a little impact on Python users, so maybeskip news tag is more appropriate here.

@rani-pinchuk
Copy link
Author

Many tests are failing with a warning - as now theDeprecationWarning is no longer hidden (and as I unedrstand it, the tests run with the equivalent of-Werror).

Many of the failing tests do not fail where one would expect to have more than one thread running. For example, intest_uuid.testIssue8621.

When printing there the number of threads usingthreading.active_count() we get1. However, when investigating further, the number of threads are actually2 - just that one of the threads is not a python thread, and therefore not counted bythreading.active_count().

Therefore, we should find a way to suppress the warning of running a fork within a thread in all the tests that fail. Petr suggests to consider using thesys.unraisablehook (seehttps://vstinner.github.io/sys-unraisablehook-python38.html) in all the places where the tests fail.

If anyone knows where this extra thread comes from, it will be appreciated if this is explained :-)

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@gpsheadgpsheadAwaiting requested review from gpsheadgpshead is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@rani-pinchuk

[8]ページ先頭

©2009-2025 Movatter.jp