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 638278 - Spaces in filenames are badly handled
Spaces in filenames are badly handled
Status: RESOLVED FIXED
Product: filemanager-actions
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nautilus-actions Maintainer(s)
Nautilus-actions Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2010-12-29 15:42 UTC by Pierre Wieser
Modified: 2011-05-07 05:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Displayed parameters (128.64 KB, image/jpeg)
2011-05-07 05:45 UTC, Pierre Wieser
Details

Description Pierre Wieser 2010-12-29 15:42:49 UTC
When a filename contains spaces, parameters which return a list should replace spaces with %20 (or quote filenames, extensions, and so on).

Reported by "Johan Spee" <quimup@coonsden.com>
Comment 1 Pierre Wieser 2010-12-29 19:50:05 UTC
Fixed in #555dc10543b6bdafd6c76687c12835e1e641e083.
Comment 2 Andreas Heinlein 2011-02-08 15:07:34 UTC
Please revert this "Fix" or make it at least optional. All my actions - which were prepared to deal with spaces in parameter lists - stopped working after upgrading from Nautilus Actions 2.30 to 3.0.5. 

They used to be called with %F, which has been converted to %M by 3.0.5, and are now getting URL-like encoded file/pathnames.

Since I am preparing these actions as Ubuntu packages, which should work with 2.30 (from Ubuntu 10.04 LTS) as well as with 3.0.5, this is really bad for me.
Comment 3 Pierre Wieser 2011-02-08 17:00:54 UTC
Hi Andreas,

You want probably say "used to be called with %M, with has been converted to %F".

There are several points here.

First is parameter renaming.

This parameter renaming has occured with 3.0 serie, in order to be compliant with DES-EMA specification [1] which itself aims to allow actions sharing between desktops.

The parameter renaming dynamically occurs at load time, so that an action which would use the '%M' parameter would be compatible both with 2.30 (and earlier) and 3.0 series.
Contrarily, an action which use the '%F' parameter is only compatible with the 3.0 serie. 
The stored action itself is only modified when updated with NACT.

Second is backward compatibility.

As of today, there is no way to write an action for N-A 3.0, using new form of parameters, so that it would be still compatible with N-A 2.30 or earlier. 

Even using several profiles, one for 3.0 and another for previous versions, would need an additional indicator unfortunately not handled by these same previous versions :(

This nonetheless may be a track to handle your issue: add the indicator, and release a 2.30.4 which handles it ?

Last point is space handling in filenames.

IMHO, the bug reported by Johan made sense, and that's why I fixed it. The actions I have tested didn't show any drawbacks, and that why I've released. Could you please send me one or two of these 'prepared' actions, so that I can examine them ?

More, what do you mean by 'make it optional' ? At compilation time ? At execution time ?

Regards
Pierre

[1] http://www.nautilus-actions.org/?q=node/377
Comment 4 Pierre Wieser 2011-02-08 17:45:32 UTC
Humm..

Also note that 3.0.6 has slightly improved the behavior for this same bug.
It may be worth to take a glance at it.

Regards
Pierre
Comment 5 Bruno Duyé 2011-03-12 02:31:46 UTC
Hi all, 
I'm using Debian 3.0.5-1 version.
Wanted to do a simple action to convert a
Comment 6 Bruno Duyé 2011-03-12 03:09:35 UTC
Hi all, 
I'm using Debian 3.0.5-1 version.
Wanted to do a simple action to convert a wav file to a mp3 one; something like :
> lame /path/to/file.wav /path/to/file.mp3

I was happy to see the new %w : (first) basename without extension.
So I created an action like that :

Path : lame
Parameters : %f %d/%w.mp3

This works great when filename and path doesn't containts spaces. If the path to the file is "/path/to/spaced name.wav", lame receive that parameters :

/path/to/spaced%20name.wav /path/to/spaced%20name.mp3
Wich is not possible to handle.
I thought that double quoting things would help; for exemple I would exept 

"%f" "%d/%w.mp3"
to produce
"/path/to/spaced%20name.wav" "/path/to/spaced%20name.mp3"
But it's not the case. 

Why there isn't a %[something] for "(first) filename without extension"
This %[something] should give : "/path/to/spaced name" if selected file is "/path/to/spaced name.wav"

This would solve the problem; at least for one file. 
If I understand well; action is repeated when more than one file are selected, and when using a "(first)" %[something]


Hope I'm clear enought
Comment 7 Pierre Wieser 2011-05-07 05:45:54 UTC
Created attachment 187405 [details]
Displayed parameters 

Hi,

As you can see in joined screen (Ubuntu 11, Nautilus-Actions 3.1.2), only URI-derived parameters make use of the %20 character encoding. All filename-derived parameters properly quote their arguments.

Regards
Pierre