After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 752611 - validate:launcher: handle folder names with spaces in --medias-paths.
validate:launcher: handle folder names with spaces in --medias-paths.
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-devtools
git master
Other Linux
: Normal normal
: 1.5.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-07-20 08:26 UTC by Vineeth
Modified: 2015-08-16 13:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
handle error cases (1.14 KB, patch)
2015-07-20 08:29 UTC, Vineeth
committed Details | Review
unquote the file path (931 bytes, patch)
2015-07-20 10:38 UTC, Vineeth
committed Details | Review
add path inside double quotes. (1.55 KB, patch)
2015-07-20 10:39 UTC, Vineeth
committed Details | Review

Description Vineeth 2015-07-20 08:26:24 UTC
If we pass a directory name with spaces to --medias-paths, it doesn't create the media info, but it shows that it passed, which is wrong.
So first things first, returning error in this scenario.
Comment 1 Vineeth 2015-07-20 08:29:38 UTC
Created attachment 307729 [details] [review]
handle error cases
Comment 2 Thibault Saunier 2015-07-20 08:37:54 UTC
Review of attachment 307729 [details] [review]:

OK
Comment 3 Thibault Saunier 2015-07-20 08:38:12 UTC
Heu, you need to put "quotes/when there are spaces in the name"
Comment 4 Vineeth 2015-07-20 08:38:52 UTC
The reason, the folders with special characters are not being handled is
we use path2url and url2path to convert the path to url in python.
This converts space to %20 and similarly for other special characters

And while passing it to g_file_set_contents, it is not able to handle '%20'

By doing path = urllib.unquote(path) in url2path, i was able to remove '%20' and replace it with space. With this change, media_info was getting created.

But, while passing the same to --set-media-info like below,
gst-validate-1.0  playbin uri=file:///home/user/gst/master/11%202/garden.mp3 --set-media-info /home/user/gst/master/11 2/garden.mp3.media_info

the file path is getting truncated like /home/user/gst/master/11, since there is a space after 11. So it is not able to set the media info..

gst-validate-1.0  playbin uri=file:///home/user/gst/master/11%202/garden.mp3 --set-media-info /home/user/gst/master/11%202/garden.mp3.media_info
this also fails.. The only way media-info is being accepted is like below

gst-validate-1.0  playbin uri=file:///home/user/gst/master/11%202/garden.mp3 --set-media-info /home/user/gst/master/11\ 2/garden.mp3.media_info

So i was wondering, if there is any way to convert the special characters in python to handle this scenario
Comment 5 Vineeth 2015-07-20 09:46:32 UTC
even when i use quotes there is the same problem...


after some experimentation found that
along with the change mentioned above "path = urllib.unquote(path) in url2path"

if i replace space with "\ " then it works ok.
But there needs to be some common API to do conversion for all special characters i guess right?

or is there any better way to do the conversion?
Comment 6 Thibault Saunier 2015-07-20 09:50:31 UTC
gst-validate-1.0  playbin uri="file:///home/user/gst/master/11%202/garden.mp3" --set-media-info "/home/user/gst/master/11 2/garden.mp3.media_info"
Comment 7 Vineeth 2015-07-20 10:38:39 UTC
Created attachment 307751 [details] [review]
unquote the file path
Comment 8 Vineeth 2015-07-20 10:39:31 UTC
Created attachment 307753 [details] [review]
add path inside double quotes.

Not exactly sure if this is proper way of adding the quotes. Please check if it is ok..
Comment 9 Thibault Saunier 2015-07-20 11:54:25 UTC
Review of attachment 307753 [details] [review]:

ok
Comment 10 Thibault Saunier 2015-07-20 11:58:20 UTC
Review of attachment 307751 [details] [review]:

Is it still needed if you quote?
Comment 11 Vineeth 2015-07-20 12:41:16 UTC
yes... this is change is for creating the media_info file.
When creating media_info file, we are using g_file_set_contents, which is not able to recognize %20 in place of space. And it fails even with double quotes.
Comment 12 Thibault Saunier 2015-07-20 12:44:00 UTC
Review of attachment 307751 [details] [review]:

OK
Comment 13 Thibault Saunier 2015-07-20 12:44:01 UTC
Review of attachment 307751 [details] [review]:

OK
Comment 14 Luis de Bethencourt 2015-07-22 15:40:15 UTC
Review of attachment 307729 [details] [review]:

commit e4906c72899e485f674ce818181306875201ad92
Author: Vineeth TM <vineeth.tm@samsung.com>
Date:   Mon Jul 20 17:27:56 2015 +0900

    validate:launcher: return on error cases properly

    When folder name contains spaces during --medias-paths, it does not
    create the media info, but still it shows as passed.
    Returing failed during this case

    https://bugzilla.gnome.org/show_bug.cgi?id=752611
Comment 15 Luis de Bethencourt 2015-07-22 15:40:35 UTC
Review of attachment 307751 [details] [review]:

commit 074406bc2c87df79641c03ab3910789d7e35d5a0
Author: Vineeth T M <vineeth.tm@samsung.com>
Date:   Mon Jul 20 19:35:34 2015 +0900

    validate:launcher: unquote the path to remove special characters

    When getting path from url using, url2path, it is returning
    special characters (%20 for space etc..), instead of returning
    plain path. path.unquote replaces the same..

    https://bugzilla.gnome.org/show_bug.cgi?id=752611
Comment 16 Luis de Bethencourt 2015-07-22 15:40:52 UTC
Review of attachment 307753 [details] [review]:

commit aa6aebe41e85f2e6b65af5af70d2ddffe0731f9a
Author: Vineeth T M <vineeth.tm@samsung.com>
Date:   Mon Jul 20 19:37:41 2015 +0900

    validate:launcher: add quotes to the file path

    When folder name contains space or other special characters,
    it fails to recognise the same and error is thrown. Adding the path
    inside  to recognise the same

    https://bugzilla.gnome.org/show_bug.cgi?id=752611