Comment 1 for bug 1087901

Revision history for this message
Michael Schwendt (mschwendt) wrote :

Yes, easy to reproduce.

Have had a brief look only:

ui.py add_uris() takes a list of URIs. Here a filename with "file://" prefix, so it starts with "file:///a.ogg" correctly. Further below in the same function, it splits of a "base" value where it gets wrong:

        if not base:
            base, notused = os.path.split(os.path.commonprefix(files))
        base += '/'

It here ends up with a base value "file:/" which is wrong. It then uses this base value to create a SoundFile object,

        for f in files:
            sound_file = SoundFile(f, base)

where we end up in file soundfile.py where it splits the uri into a base_path and a filename:

        if base_path:
            self.base_path = base_path
            self.filename = self.uri[len(self.base_path):]
        else:
            self.base_path, self.filename = os.path.split(self.uri)
            self.base_path += '/'

Obviously, splitting off "file:/" of "file:///a.ogg" results in "//a.ogg".

No idea why it does all that. A brute-force work-around would have been to simply replace a leading '//' from the filename, but interestingly, GStreamer then refused to open the file /a.ogg (because it's owned by root.root, of course), and the --debug output said:

Error: <b>GStreamer Error:</b>
Could not open resource for writing.
<i>(/a.ogg)</i>

Error: <b>GStreamer Error:</b>
Could not open resource for writing.
<i>(/a.ogg)</i>
Cannot set permission on '/a.wav'