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 411209 - filenames with spaces in not opened
filenames with spaces in not opened
Status: RESOLVED DUPLICATE of bug 429107
Product: deskbar-applet
Classification: Deprecated
Component: general
2.17.x
Other All
: Normal normal
: ---
Assigned To: Deskbar Applet Maintainer(s)
Deskbar Applet Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2007-02-23 14:05 UTC by Iain Nicol
Modified: 2007-06-13 12:01 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18



Description Iain Nicol 2007-02-23 14:05:08 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
Comment 1 Raphael Slinckx 2007-02-28 15:05:03 UTC
Fixed in svn thanks !
Comment 2 Iain Nicol 2007-06-08 04:29:30 UTC
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.
Comment 3 Iain Nicol 2007-06-08 04:34:11 UTC
Sorry for the spam, but I meant to write for beagle-live.py:
"action": lambda d: url_show_file(d["escaped_uri"], escaped=True)
Comment 4 thomas.goose 2007-06-13 01:39:17 UTC
Is this now the same as Bug 429107 ?
Comment 5 Iain Nicol 2007-06-13 12:01:21 UTC

*** This bug has been marked as a duplicate of 429107 ***