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

[3.10] gh-98552: Fix preloading '__main__' with forkserver being broken#98924

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

Closed

Conversation

@aggieNick02
Copy link

@aggieNick02aggieNick02 commentedOct 31, 2022
edited by bedevere-bot
Loading

This has been broken for a long time (9 years).

We do this by using spawn.get_preparation_data() and then using the values in that dictionary appropriately. This lets us also fix the setting of sys.path (which never worked) and other minor properties of the forkserver process.

While updating the test to verify these fixes, we also discovered that forkserver was not flushing stdout/stderr before it forked to create a new process. This caused the updated test to fail because unflushed output in the forkserver would then be printed by the forked process as well. This is now fixed too.

…n for along time (9 years).We do this by using spawn.get_preparation_data() and then using thevalues in that dictionary appropriately. This lets us also fix thesetting of sys.path (which never worked) and other minor properties ofthe forkserver process.While updating the test to verify these fixes, we also discovered thatforkserver was not flushing stdout/stderr before it forked to create anew process. This caused the updated test to fail because unflushedoutput in the forkserver would then be printed by the forked process aswell. This is now fixed too.
@ghost
Copy link

ghost commentedOct 31, 2022
edited by ghost
Loading

All commit authors signed the Contributor License Agreement.
CLA signed

@brettcannonbrettcannon removed their request for reviewNovember 1, 2022 22:53
@ambv
Copy link
Contributor

Hey@aggieNick02, thanks for this fix. It looks promising. However, the change should go against themain branch and not 3.10 as the issue needs fixing in 3.12 and 3.11 as well.

I realize we weren't sufficiently explicit about this in the past so I updated the devguide to explain what's up:
https://devguide.python.org/getting-started/pull-request-lifecycle/#good-prs

@aggieNick02
Copy link
Author

Ah, ok. Thanks for updating the instructions to make it clear. I wanted to do whatever gave it the best chance at making it into 3.10 (to be part of Ubuntu 22.04 LTS). I'll make a new PR againstmain shortly. Thanks!

@aggieNick02
Copy link
Author

Alright, I put this against main. In the process realized I wasn't passing down theraise_exception option in one place. So I added a test that would catch that and fixed it.#99515.

@aggieNick02
Copy link
Author

Closing since obsoleted by new PR against correct branch.

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

Reviewers

@encukouencukouAwaiting requested review from encukouencukou is a code owner

@ericsnowcurrentlyericsnowcurrentlyAwaiting requested review from ericsnowcurrentlyericsnowcurrently is a code owner

@ncoghlanncoghlanAwaiting requested review from ncoghlanncoghlan is a code owner

@warsawwarsawAwaiting requested review from warsawwarsaw is a code owner

@1st11st1Awaiting requested review from 1st11st1 is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@aggieNick02@ambv@bedevere-bot

[8]ページ先頭

©2009-2026 Movatter.jp