New submission from Julian <git...@somethinkodd.com>:

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.

----------
components: Library (Lib)
messages: 414393
nosy: Julian-O
priority: normal
severity: normal
status: open
title: winsound.PlaySound should accept pathlib.Path instances
type: enhancement

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46905>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to