Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'syntax': 0.03; 'error:': 0.05; 'linux,': 0.05; 'subject:skip:s 10': 0.05; 'completeness': 0.07; 'tom': 0.07; 'python': 0.09; 'filename,': 0.09; 'path,': 0.09; 'received:155': 0.09; 'throw': 0.09; 'windows,': 0.09; 'cc:addr:python-list': 0.10; 'extensions': 0.13; 'skip:# 20': 0.13; 'disclaimers': 0.16; 'disclaimers,': 0.16; 'from:addr:jpmorgan.com': 0.16; 'received:155.180': 0.16; 'received:155.180.234': 0.16; 'received:155.180.234.122': 0.16; 'received:159.53': 0.16; 'received:159.53.110': 0.16; 'received:159.53.110.174': 0.16; 'received:bankone.net': 0.16; 'received:exchad.jpmchase.net': 0.16; 'received:jpmchase.com': 0.16; 'received:jpmchase.net': 0.16; 'received:se3.svr.bankone.net': 0.16; 'received:sj2.jpmchase.com': 0.16; 'received:svr.bankone.net': 0.16; 'securities,': 0.16; 'subject:Problem': 0.16; 'subject:windows': 0.16; 'subprocess': 0.16; 'url:disclosures': 0.16; 'url:jpmorgan': 0.16; 'wrote:': 0.17; 'skip:g 40': 0.17; 'shell': 0.18; '>>>': 0.18; 'windows': 0.19; 'import': 0.21; 'os,': 0.22; 'cc:2**0': 0.23; 'this:': 0.23; 'received:169.254': 0.24; 'cc:addr:python.org': 0.25; 'header:In- Reply-To:1': 0.25; 'skip:# 10': 0.27; '2.6': 0.27; 'accuracy': 0.27; 'label': 0.27; "doesn't": 0.28; 'feature,': 0.29; 'received:169': 0.29; 'probably': 0.29; "skip:' 10": 0.30; 'usually': 0.30; 'expect': 0.31; 'path': 0.35; 'pm,': 0.35; 'but': 0.36; 'skip:g 30': 0.36; 'subject:with': 0.36; 'should': 0.36; 'charset:us-ascii': 0.36; 'why': 0.37; 'subject:: ': 0.38; 'skip:o 20': 0.38; 'shows': 0.38; 'skip:" 10': 0.40; 'different': 0.63; 'information,': 0.63; 'url:email': 0.63; 'legal': 0.65; 'subject': 0.66; 'purchase': 0.67; 'lose': 0.71; 'as:': 0.75; 'sale': 0.76; 'received:169.254.8': 0.84; 'angel': 0.93 X-DKIM: OpenDKIM Filter v2.1.3 sj2.jpmchase.com qANMWtDr025913 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpmorgan.com; s=smtpout; t=1353709976; bh=TT4NAX+IU7kb5zexzy9mgLko3fSo8RzY3kKGdHxvaiA=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Transfer-Encoding:MIME-Version:Content-Type; b=MZDtbGhst1yZ23nn+vJ9DJE/M3pw+KHsBGs7UCrdurWOzfJMAfr2sEYJgURdrajj0 cBFTuhAJ8EJ+R5+Uz0SJ+bZefvCcVNq5FtbVTrPduZbqeL68G7hvDcqlwtsda8wuFn jSqCQGhquATSdvrMAchOLXWYrQl605dWYfXfGMls= From: "Prasad, Ramit" To: Tom Borkin Subject: RE: Problem with subprocess.call and windows schtasks Thread-Topic: Problem with subprocess.call and windows schtasks Thread-Index: AQHNxZNoB34Z+hDZRU+m6JnyCo/OmJfwHzeAgAOaowCAAB3QAIAEMdEA Date: Fri, 23 Nov 2012 22:32:48 +0000 References: <50AC2E38.8050303@davea.name> In-Reply-To: <50AC2E38.8050303@davea.name> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.67.79.47] Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-DLP-FWD: Yes Content-Type: text/plain; charset="us-ascii" Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1353709985 news.xs4all.nl 6854 [2001:888:2000:d::a6]:49104 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:33870 Dave Angel wrote:=0D=0A> =0D=0A> On 11/20/2012 06:41 PM, Tom Borkin wrote:= =0D=0A> =0D=0A> (Please don't top-post=2E Now we lose all the context)=0D= =0A> > Using shlex, I now have this:=0D=0A> > #!\Python27\python=0D=0A> > i= mport os, subprocess=0D=0A> > path =3D os=2Epath=2Ejoin("C:\\", "Program Fi= les", "Apache Group", "Apache2",=0D=0A> > "htdocs", "ccc", "run_alert=2Epy"= )=0D=0A> > #subprocess=2Ecall(['SchTasks', '/Create', '/SC', 'ONCE', '/TN',= '"test"',=0D=0A> > '/TR', path, '/ST', '23:50'])=0D=0A> > subprocess=2Ecal= l(['SchTasks', '/Create', '/SC', 'ONCE', '/TN', '"test"',=0D=0A> > '/TR', '= run_alert=2Epy', '/ST', '23:50'])=0D=0A> > Both of the above commands throw= the same error:=0D=0A> > ERROR: The filename, directory name or volume lab= el syntax is incorrect=2E=0D=0A> =0D=0A> I don't use Windows, but doesn't a= Windows program usually have an =2Eexe=0D=0A> extension? So why would you= expect it to find SchTasks ? Adding=0D=0A> extensions is a shell feature,= and you're not using the shell=2E=0D=0A> =0D=0A> Also, you should take a l= ook at the value "path"=2E On Linux, it shows up as:=0D=0A> =0D=0A> C:\\/P= rogram Files/Apache Group/Apache2/htdocs/ccc/run_alert=2Epy=0D=0A> =0D=0A> = It'll be different under Windows, but probably still wrong=2E=0D=0A=0D=0AWi= ndows 7 + Python 2=2E6=0D=0A>>> os=2Epath=2Ejoin("C:\\", "Program Files", "= Apache Group", "Apache2",=0D=0A=2E=2E=2E "htdocs", "ccc", "run_alert=2Epy"= )=0D=0A'C:\\Program Files\\Apache Group\\Apache2\\htdocs\\ccc\\run_alert=2E= py'=0D=0A=0D=0A=0D=0A~Ramit=0D=0A=0D=0A=0D=0AThis email is confidential and= subject to important disclaimers and=0D=0Aconditions including on offers f= or the purchase or sale of=0D=0Asecurities, accuracy and completeness of in= formation, viruses,=0D=0Aconfidentiality, legal privilege, and legal entity= disclaimers,=0D=0Aavailable at http://www=2Ejpmorgan=2Ecom/pages/disclosur= es/email=2E