Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Neil Cerutti Newsgroups: comp.lang.python Subject: Re: "python.exe has stopped working" when os.execl() runs on Windows 7 Date: 2 May 2013 12:50:09 GMT Organization: Norwich University Lines: 26 Message-ID: References: <2e11de8b-f7e1-407f-a2fd-a08d5ce55d0b@googlegroups.com> <9ac24332-ead8-4889-815a-a12052f43742@googlegroups.com> <0d9d14dc-877b-4b68-aefe-834b530dee2c@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: individual.net Hdfx30BmPkkExCC083jVig1uog6rFQdoTXCS581qfD7q+yV8KR Cancel-Lock: sha1:HZcL1GDRnP8LEnWDIcEvSb4zsF8= User-Agent: slrn/0.9.9p1/mm/ao (Win32) Xref: csiph.com comp.lang.python:44619 On 2013-05-01, F?bio Santos wrote: > Reproduced in Windows 7 Ultimate: > >>>> import os >>>> os.execl('ping.exe', '') > > At this point the REPL freezes, and windows prompts me to close Python > since it stopped responding. To repeat others and the documentation: In either case, the arguments to the child process should start with the name of the command being run, but this is not enforced. The argument list must contain the executable as its first argument. Python indeed crashes if I don't include the first argument as directed. In any case, on Windows I would normally need to do something like this instead: os.execlp('cmd.exe', 'cmd.exe', '/K', 'ping.exe') -- Neil Cerutti