Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue25387

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:sound_msgbeep doesn't check the return value of MessageBeep
Type:behaviorStage:resolved
Components:WindowsVersions:Python 3.6
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: Alexander Riccio, paul.moore, python-dev, steve.dower, tim.golden, zach.ware
Priority:normalKeywords:patch

Created on2015-10-13 00:23 byAlexander Riccio, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
check_msgbeep_error.diffzach.ware,2016-08-14 20:58review
Messages (5)
msg252901 -(view)Author: Alexander Riccio (Alexander Riccio)*Date: 2015-10-13 00:30
A really minor issue (probably qualifies for the "easy" keyword):sound_msgbeep (inhttp://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".
msg271949 -(view)Author: Zachary Ware (zach.ware)*(Python committer)Date: 2016-08-04 04:28
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.
msg272694 -(view)Author: Zachary Ware (zach.ware)*(Python committer)Date: 2016-08-14 20:58
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.
msg274451 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2016-09-05 22:33
New changeset4e5b3dc049cc by Zachary Ware in branch 'default':Issue#25387: Check return value of winsound.MessageBeephttps://hg.python.org/cpython/rev/4e5b3dc049cc
msg274452 -(view)Author: Zachary Ware (zach.ware)*(Python committer)Date: 2016-09-05 22:34
I decided not to backport.  If anyone else would like to, I won't stand in their way.
History
DateUserActionArgs
2022-04-11 14:58:22adminsetgithub: 69574
2016-09-05 22:34:01zach.waresetstatus: open -> closed
versions: - Python 2.7, Python 3.5
messages: +msg274452

resolution: fixed
stage: patch review -> resolved
2016-09-05 22:33:09python-devsetnosy: +python-dev
messages: +msg274451
2016-08-14 20:58:49zach.waresetfiles: +check_msgbeep_error.diff
keywords: +patch
messages: +msg272694

stage: needs patch -> patch review
2016-08-04 04:28:26zach.waresetstage: needs patch
messages: +msg271949
versions: + Python 2.7, Python 3.5
2015-10-13 00:30:51Alexander Ricciosetnosy:paul.moore,tim.golden,zach.ware,steve.dower,Alexander Riccio
messages: +msg252901
2015-10-13 00:23:20Alexander Ricciocreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp