When I try to play local file with "#" in filename on my Linux machine, it displays:
Error: message about my installation of GStreamer missing plugin /var/tmp/portage/media-libs/gst-plugins-base-0.10.36-r1/work/gst-plugins-base-0.10.36/gst/playback/gstplaybasebin.c(1686): gen_source_element (): /GstPlayBin:player:
No URI handler for file
I use this to set URI:
self.player.set_property('uri', 'file://' + filepath)
where filepath is absolute path to e.g. MP3 file "/home/me/untitled #1.mp3"
Is there some kind of escape or workaround?
filepath
should be URL quoted.Use
urllib.parse.quote()
(Python 3) orurllib.quote()
(Python 2)This is what I use (Python 3) which should work on Windows too: