[issue46905] winsound.PlaySound should accept pathlib.Path instances

2022-03-02 Thread Eryk Sun
Change by Eryk Sun : -- components: +Windows keywords: +easy (C) nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker ___

[issue46905] winsound.PlaySound should accept pathlib.Path instances

2022-03-02 Thread Eryk Sun
Eryk Sun added the comment: PlaySound() is implemented by the C function winsound_PlaySound_impl() in "PC/winsound.c". To support pathlike objects, it could use `soundname = PyOS_FSPath(sound)`, and require soundname to be a Unicode string via PyUnicode_Check(soundname). Or it could more

[issue46905] winsound.PlaySound should accept pathlib.Path instances

2022-03-02 Thread Julian
New submission from Julian : 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