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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sound_msgbeep doesn't check the return value of MessageBeep #69574
Comments
A really minor issue (probably qualifies for the "easy" keyword): sound_msgbeep (in http://svn.python.org/projects/python/trunk/PC/winsound.c) doesn't check the return value of MessageBeep (https://msdn.microsoft.com/en-us/library/windows/desktop/ms680356.aspx). This is a very minor issue, but the possibility of failure is not mentioned in the winsound documentation. Invisible failures are quite surprising. A message in the Gnome archives (https://mail.gnome.org/archives/commits-list/2010-November/msg01938.html) has an example "fix". |
Though the source link is incredibly out of date (we've been on hg.python.org for about 5 years now, and are soon to move to Github), this is a current issue. The suggested 'example "fix"' is not applicable, though; in that case, MessageBeep is just used in preference to Beep, and falls back to Beep if MessageBeep fails. |
Here's a patch. This has the possibility of breaking existing code, but the fix is simple (just catch RuntimeError) and is probably more in line with what's expected. |
New changeset 4e5b3dc049cc by Zachary Ware in branch 'default': |
I decided not to backport. If anyone else would like to, I won't stand in their way. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: