Fixed wrong filename bug with specialchars #10

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@fonfon
fonfon commented Dec 8, 2014

When adding a folder that contains '&' (and probably other special chars):
os.path.dirname sticks to '&', but gnomevfs.URI converts this to "%26".

filelist = vfs_walk(gnomevfs.URI(uri)) --> "%26"
base = os.path.dirname(uri) --> "&"

In SoundFile.__init__(), self.filename is created by cutting off the
length of the base. This leads to wrong filenames, so the output of
soundconverter was stored in wrong, newly created directories.

Maybe there are better ways to fix this issue -- I'm extremely unfamiliar with the codebase.

And as I'm already here:
soundconverter is an awesome project. Every time I use it I'm surprised by its simple user interface which still offers all of the functionality I need, although sound conversion itself isn't that easy. For me it's a showcase project for a clean UI that simplifies more complicated tasks for the enduser in a good way. Thanks a lot!

@fonfon fonfon Fixed wrong filename bug with specialchars
When adding a folder that contains '&' (and probably other special chars):
os.path.dirname sticks to '&', but gnomevfs.URI converts this to "%26".

The filelist is created with gnomevfs.URI(uri) --> "%26"
But for 'base', only os.path.dirname is used --> "&"
In SoundFile.__init__(), self.filename is created by cutting off the
length of the base. This lead to wrong filenames, so the output of
soundconverter was stored in wrong, newly created directories.
2087fd7
@kassoulet
Owner

First, sorry for the late answer.

Good catch ! There is definitely an issue here.
In SoundConverter the filenames are converted to URIs as soon as possible, so in add_uris(), the filenames passed must be correct URIs already. The caller must take care of it.
The problem here beeing that the file-drop callback pass them as-is instead of making sure the URIs are correct.

The appropriate fix is here :
ecea422

Thank you very much for your help !

@kassoulet kassoulet closed this Dec 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment