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-90872: Handle negative timeouts for wait on Windows#32079

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
jkloth wants to merge2 commits intopython:main
base:main
Choose a base branch
Loading
fromjkloth:issue46716

Conversation

jkloth
Copy link
Contributor

@jklothjkloth commentedMar 23, 2022
edited by bedevere-appbot
Loading

Update Windows wait timeout handling to match the behavior for POSIX. This PR also catches overly values that would conflict with the INFINITE timeout value used in_winapi.WaitForSingleObject.

These changes should be backported to the maintenance branches.

https://bugs.python.org/issue46716

@eryksun
Copy link
Contributor

Did you want to create an issue to fix_winapi.WaitForSingleObject() or theDWORD converter in_winapi? I suppose all call sites of_winapi functions that takeDWORD parameters will have to be checked.

@jkloth
Copy link
ContributorAuthor

I was thinking to the DWORD converter change as a separate PR that would not be a candidate for backport. While_winapi contents are considered "private", I know that when I write scripts only for use on Windows, I'll reach for that module for functions before considering using ctypes. All the needed "wrapping stuff" (exceptions for errors, reference counting, etc) is handled for me.

The change of negative values to exceptions, while probably not relied upon, would be a breaking change for a dot release. Being limited to a new release (3.11) would be easier to reason about downstream rather than a "random" bugfix release (say, 3.9.12). IMO.

@serhiy-storchaka
Copy link
Member

Please add tests and a NEWS entry.

@serhiy-storchakaserhiy-storchaka added needs backport to 3.11only security fixes needs backport to 3.12only security fixes labelsFeb 23, 2024
@serhiy-storchakaserhiy-storchaka changed the titlebpo-46716: Handle negative timeouts for wait on Windowsgh-90872: Handle negative timeouts for wait on WindowsFeb 23, 2024
Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

How difficult is to write tests?

@eryksun
Copy link
Contributor

How difficult is to write tests?

Tests can spawn a child process that exits after a few seconds. With this PR, a timeout that's larger than4294967.295 should raiseOverflowError. For example, the current implementation mistakenly wraps 4294968 around to 0.704, leading toTimeoutExpired. With this PR, a negative timeout should be handled as 0. For example, the current implementation wraps -1 to4294966.296, and the wait will succeed when the child exits, instead of raisingTimeoutExpired.

@serhiy-storchakaserhiy-storchaka added needs backport to 3.13bugs and security fixes and removed needs backport to 3.11only security fixes labelsMay 9, 2024
@serhiy-storchakaserhiy-storchaka added the needs backport to 3.14bugs and security fixes labelMay 8, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@serhiy-storchakaserhiy-storchakaserhiy-storchaka left review comments

@gpsheadgpsheadAwaiting requested review from gpsheadgpshead is a code owner

Assignees
No one assigned
Labels
awaiting reviewneeds backport to 3.12only security fixesneeds backport to 3.13bugs and security fixesneeds backport to 3.14bugs and security fixes
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

6 participants
@jkloth@eryksun@serhiy-storchaka@the-knights-who-say-ni@ezio-melotti@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp