Title: winsound module very unstable in Windows 10
Type: behavior Stage: resolved
Components: Extension Modules Versions: Python 3.5, Python 2.7
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Ganning Liu, zach.ware
Priority: normal Keywords:

Created on 2016-04-15 03:29 by Ganning Liu, last changed 2016-04-15 04:36 by zach.ware. This issue is now closed.

Messages (4)
msg263438 - (view) Author: Ganning Liu (Ganning Liu) Date: 2016-04-15 03:29
Cannot using winsound.Beep() in .py file (run as module), get error information like:

Traceback (most recent call last):
  File "C:\Users\liuga\Desktop\", line 2, in <module>
AttributeError: module 'winsound' has no attribute 'Beep'

And also failed in interactive shell occasionally.
msg263440 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2016-04-15 03:41
This looks very like a case of shadowing a standard library module.  Just before your call to Beep(), try "print(winsound.__file__)".  If it's not "C:\SomePathToPython\DLLs\winsound.pyd" (with an appropriate real path in place of "SomePathToPython"), it's the path of the file that you should rename to something other than "".
msg263443 - (view) Author: Ganning Liu (Ganning Liu) Date: 2016-04-15 04:29
Thanks Zachary, it's not a bug!
msg263444 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2016-04-15 04:36
Glad I could guide you to a solution :)
Date User Action Args
2016-04-15 04:36:06zach.waresetmessages: + msg263444
stage: resolved
2016-04-15 04:29:13Ganning Liusetstatus: pending -> closed

messages: + msg263443
2016-04-15 03:41:08zach.waresetstatus: open -> pending

nosy: + zach.ware
messages: + msg263440

type: compile error -> behavior
resolution: not a bug
2016-04-15 03:29:55Ganning Liucreate