Merge lp:~brian.curtin/ubuntuone-client/correct-subprocess-args into lp:ubuntuone-client

Proposed by Brian Curtin on 2012-10-12
Status: Merged
Approved by: Manuel de la Peña on 2012-10-15
Approved revision: 1335
Merged at revision: 1342
Proposed branch: lp:~brian.curtin/ubuntuone-client/correct-subprocess-args
Merge into: lp:ubuntuone-client
Diff against target: 26 lines (+8/-3)
1 file modified
ubuntuone/syncdaemon/utils.py (+8/-3)
To merge this branch: bzr merge lp:~brian.curtin/ubuntuone-client/correct-subprocess-args
Reviewer Review Type Date Requested Status
Manuel de la Peña (community) Approve on 2012-10-15
dobey (community) 2012-10-12 Approve on 2012-10-15
Review via email: mp+129506@code.launchpad.net

Commit Message

- Use procutils.which to identify the full path of a python executable to be spawned on Windows.

Description of the Change

As was done on SSO, insert the full path to the proper python executable before passing the argument string off to be spawned.

To post a comment you must log in.
dobey (dobey) :
review: Approve
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/syncdaemon/utils.py'
2--- ubuntuone/syncdaemon/utils.py 2012-07-13 16:06:27 +0000
3+++ ubuntuone/syncdaemon/utils.py 2012-10-12 20:11:38 +0000
4@@ -31,6 +31,8 @@
5 import os
6 import sys
7
8+from twisted.python import procutils
9+
10 from dirspec.utils import get_program_path
11
12 DARWIN_APP_NAMES = {'ubuntuone-syncdaemon': 'UbuntuOne Syncdaemon.app'}
13@@ -49,7 +51,10 @@
14
15 # adjust cmd for platforms using buildout-generated python
16 # wrappers
17- if (getattr(sys, 'frozen', None) is None
18- and sys.platform in ('win32', 'darwin')):
19- cmd_args.insert(0, 'python')
20+ if getattr(sys, 'frozen', None) is None:
21+ if sys.platform in ('darwin'):
22+ cmd_args.insert(0, 'python')
23+ elif sys.platform in ('win32'):
24+ cmd_args.insert(0, procutils.which("python.exe"))
25+
26 return cmd_args

Subscribers

People subscribed via source and target branches