Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!feeder3.eweka.nl!81.171.88.15.MISMATCH!eweka.nl!lightspeed.eweka.nl!194.134.4.91.MISMATCH!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'does.': 0.07; 'override': 0.07; 'script,': 0.07; 'dict': 0.09; 'from:addr:timgolden.me.uk': 0.09; 'from:name:tim golden': 0.09; 'message-id:@timgolden.me.uk': 0.09; 'double-quote': 0.16; 'param': 0.16; 'received:74.55.86': 0.16; 'received:74.55.86.74': 0.16; 'received:smtp.webfaction.com': 0.16; 'received:webfaction.com': 0.16; 'runs,': 0.16; 'this:': 0.16; 'wrote:': 0.18; 'appropriate': 0.22; 'header:In-Reply-To:1': 0.22; "shouldn't": 0.23; 'pass': 0.29; 'second,': 0.30; 'tjg': 0.30; 'least': 0.30; 'app': 0.31; 'version': 0.32; 'certainly': 0.32; 'list': 0.32; 'header:User- Agent:1': 0.33; 'to:addr:python-list': 0.34; 'things': 0.34; 'skip:" 20': 0.35; 'david': 0.36; 'are.': 0.37; 'skip:" 10': 0.37; 'received:192': 0.37; 'using': 0.38; 'received:192.168.0': 0.38; 'either': 0.39; 'should': 0.39; 'to:addr:python.org': 0.40; 'received:192.168': 0.40; 'your': 0.61; 'from:addr:mail': 0.64; 'dict,': 0.84; 'subject:write': 0.84; 'subject:made': 0.93 Date: Mon, 02 Jan 2012 11:11:27 +0000 From: Tim Golden User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Can't write to a directory made w/ os.makedirs References: <50693cc2-93c9-481d-9fb1-42312e69b2d9@c42g2000prb.googlegroups.com> <91830ffb-00d9-4fd1-b771-ad59374334ec@n22g2000prh.googlegroups.com> <6348b96c-f7a9-4ca6-a704-c90d25f07788@y25g2000prg.googlegroups.com> In-Reply-To: <6348b96c-f7a9-4ca6-a704-c90d25f07788@y25g2000prg.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1325502694 news.xs4all.nl 6978 [2001:888:2000:d::a6]:50158 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:18320 On 02/01/2012 03:14, David Goldsmith wrote: > Here's my script, in case that helps: It certainly does. A few things occur to me. First, you shouldn't need to double-quote the path; the subprocess.call should do that for you as long as you're using the list version of the param -- which you are. Second, you almost certainly don't want to be using the env param, at least not in the way you are. Depending on the way in which your app runs, either pass the appropriate directory as the cwd= param, or copy and override the current environ dict, ie either do this: subprocess.call ( ['c:/program files/somewhere/app.exe', 'blah1', 'blah2'], cwd="c:/somewhere/else" ) or this: env = dict (os.environ) env['PATH'] = "c:/somewhere/else" # or env['PATH'] += ";c:/somewhere/else" subprocess.call ( ['c:/program files/somewhere/app.exe', 'blah1', 'blah2'], env=env ) See if any of that helps TJG