GNOME Bugzilla – Bug 411209
filenames with spaces in not opened
Last modified: 2007-06-13 12:01:21 UTC
Please describe the problem: The beagle-live handler (and maybe others?) is unable to launch files with space in their names. Steps to reproduce: 1. Start the Beagle daemon, and enable the deskbar handler Beagle Live 1. Create a file with a unique name (so it can be found), and without spaces either in the filename or in the directory names. e.g. "asdfasdfasdf". 2. Using Deskbar, search for "asdfasdfasdf", and click the Beagle Live entry to launch the file. That should work. (provided Beagle indexes the file properly) 3. Create a file with a unique name and with spaces in the name, such as "asdfasdf asdf". 4. Using Deskbar, search for "asdfasdf". 5. Click the result for the file "asdfasdf asdf". Actual results: Deskbar is unable to launch the file, and comes up with two different error dialogs. Expected results: The file should be launched using the default application. Does this happen every time? Yes Other information: When beagle-live tries to launch a file, it calls deskbar.Utils.url_show_file. beagle-live gives input to this function of the form '/home/user/asdfasdfasdf' or '/home/user/asdfasdf asdf'. Only when there are no spaces does this function work. Note that if the input to this function is prepended with 'file://', then the function will work. e.g. deskbar.Utils.url_show_file('file:///home/user/asdfasdf asdf') will work
Fixed in svn thanks !
Hi, I thought the fix I gave worked, but it doesn't now; I think there's been a regression. I'm running Beagle 0.2.16.3, and Deskbar Applet 2.18.1. Files from Beagle Live will not open if the filename and/or the directory name contain a space. Analysis: The action for the file result is currently: lambda d: url_show_file("file://"+d["uri"]) This structure "d" contains the fields "uri" and "escaped_uri". Both fields contain the "file://" part, which means we shouldn't add that ourselves any more. Also, they are both (by mistake?) escaped. So maybe we should pass escaped_uri instead of uri to url_show_file, because it doesn't lie about whether it's escaped. Then we have another problem: url_show_file expects a non-escaped url. So then you have to add a parameter to url_show_file indicating whether it's escaped or not. I'm not good with patches; sorry: Utils.py: def url_show_file(url, escaped=False): try: if escaped: uri = url else: uri = gnomevfs.escape_host_and_path_string(url) gnomevfs.url_show(uri) etc handlers/beagle-live.py, in the "File" TYPE: "action" : d["escaped_uri"] Maybe there's a more elegant solution, if you figure out why "uri" is escaped. It might not be worth it though. I'm waiting for you to tell me that me working this out was all pointless due to the SOC project obsoleting this crusty code. :-) Regards.
Sorry for the spam, but I meant to write for beagle-live.py: "action": lambda d: url_show_file(d["escaped_uri"], escaped=True)
Is this now the same as Bug 429107 ?
*** This bug has been marked as a duplicate of 429107 ***