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 702885 - SendTo plugin does not work with music files containing apostrophes
SendTo plugin does not work with music files containing apostrophes
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: Plugins (other)
2.99.x
Other Linux
: Normal normal
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-06-23 08:37 UTC by foss.freedom
Modified: 2014-08-03 09:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch -p0 to resolve this bug-report (477 bytes, patch)
2013-06-23 08:37 UTC, foss.freedom
needs-work Details | Review

Description foss.freedom 2013-06-23 08:37:16 UTC
Created attachment 247552 [details] [review]
patch -p0 to resolve this bug-report

The following error is observed with music files containing apostrophes:

dad@dad-VirtualBox:~/.local/share/rhythmbox/plugins/sendto$ rhythmbox
Traceback (most recent call last):
  • File "/home/dad/.local/share/rhythmbox/plugins/sendto/sendto.py", line 89 in send_to
    GLib.spawn_command_line_async(cmdline)
  • File "/usr/lib/python2.7/dist-packages/gi/types.py", line 43 in function
    return info.invoke(*args, **kwargs)
gi._glib.GError: Text ended before matching quote was found for '. (The text was 'nautilus-sendto file:///media/sf_Music/Elvis%20Presley%20-%2030%20%231%20Hits/02%20-%20Elvis%20Presley%20-%20Don't%20Be%20Cruel.ogg')

The fix is straightforward - just need to escape the aphostrophe so that the cmd line works correctly.

Please find enclosed a diff for the patch
Comment 1 Jonathan Matthew 2014-08-03 09:27:09 UTC
Review of attachment 247552 [details] [review]:

::: plugins/sendto/sendto.py
@@ +73,3 @@
 		entries = page.get_entry_view().get_selected_entries()
 		cmdline = 'nautilus-sendto ' + " ".join(entry.get_playback_uri() for entry in entries)
+                cmdline = cmdline.replace("'", r"\'")

no, this needs to do proper shell escaping with shlex.quote()
Comment 2 Jonathan Matthew 2014-08-03 09:28:58 UTC
fixed properly in commit a55a46c