This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Julian-O
Recipients Julian-O
Date 2022-03-03.00:02:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1646265779.67.0.979185331042.issue46905@roundup.psfhosted.org>
In-reply-to
Content
The library function winsound.PlaySound takes a sound parameter. One of the valid arguments is a path to a WAV filename.

Since Python 3.4, paths can be cleanly represented with PathLib.Path instances.

However, if you pass a Path instance to PlaySound, it responds with:

   TypeError: 'sound' must be str or None, not 'WindowsPath'

This can be quickly fixed in the caller by passing str(the_path_instance) instead, but it would be cleaner if PlaySound accepted Python's preferred method of representing paths.
History
Date User Action Args
2022-03-03 00:02:59Julian-Osetrecipients: + Julian-O
2022-03-03 00:02:59Julian-Osetmessageid: <1646265779.67.0.979185331042.issue46905@roundup.psfhosted.org>
2022-03-03 00:02:59Julian-Olinkissue46905 messages
2022-03-03 00:02:59Julian-Ocreate