Merge lp:~ebichete/olive/bugfix_lp374036 into lp:olive

Proposed by Edward Ari Bichetero
Status: Merged
Merged at revision: 695
Proposed branch: lp:~ebichete/olive/bugfix_lp374036
Merge into: lp:olive
Diff against target: 18 lines (+2/-2)
1 file modified
olive/ (+2/-2)
To merge this branch: bzr merge lp:~ebichete/olive/bugfix_lp374036
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) code Approve
Olive Team Pending
Review via email:

Description of the change

Switch the file/directory "launch" (actually open) code to use os.spawn() instead of os.system(). By explicitly filling the launched process' argument list we sidestep the shell's command splitting and correctly handle paths that contain spaces.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Looks good to me.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'olive/'
2--- olive/ 2010-05-25 17:10:52 +0000
3+++ olive/ 2010-10-25 13:26:26 +0000
4@@ -30,12 +30,12 @@
5 # Maybe Gnome?
6 exe = search_exe('gnome-open')
7 if exe != None:
8- os.system("gnome-open %s" % normpath)
9+ os.spawnlp(os.P_WAIT, "gnome-open", "gnome-open", normpath)
10 return
11 # Maybe KDE?
12 exe = search_exe('kfmclient')
13 if exe != None:
14- os.system("kfmclient exec file:%s" % normpath)
15+ os.spawnlp(os.P_WAIT, "kfmclient", "kfmclient", "exec", "file:%s" % normpath)
16 return
18 # TODO: support other platforms


People subscribed via source and target branches