"python.exe has stopped working" when os.execl() runs on Windows 7
Was trying os.execl() and got a "python.exe has stopped working" on my Windows 7 Ultimate SP1 x64 desktop. I'm using Python 2.7.4 and that happens when the second arg is ''. For example: os.execl('filename.exe','') Wtf? :( http://postimg.org/image/vdliyuenh/ -- http://mail.python.org/mailman/listinfo/python-list
Re: "python.exe has stopped working" when os.execl() runs on Windows 7
Yes, just those two lines cause the error. 'filename.exe' exists and runs ok in the command prompt. Any other executable cause the problem, also '', for example: os.execl('','') If doesn't work on Windows it should give an error message, right? On Saturday, April 27, 2013 9:55:34 PM UTC-3, Dave Angel wrote: > On 04/27/2013 08:22 PM, cormog...@gmail.com wrote: > > > Was trying os.execl() and got a "python.exe has stopped working" on my > > Windows 7 Ultimate SP1 x64 desktop. > > > > > > I'm using Python 2.7.4 and that happens when the second arg is ''. For > > example: > > > > > > os.execl('filename.exe','') > > > > > > > > > Wtf? :( > > > > > > http://postimg.org/image/vdliyuenh/ > > > > > > > Do you really have a program called filename.exe ? > > > > Are you by any chance running this inside some shell or debugger, like > > IDLE or KOMODO? Or is it a GUI program ? More specifically, does it > > still give an error like that if you have a two-line Python program: > > import os > > os.execl('filename.exe', '') > > > > execl is supposed to replace the current (python) program, with the > > filename.exe one. But if the current program has any OS resources in > > use (like file objects), they don't get flushed/released. > > > > The execl was intended for use on Unix, and Windows can't really do what > > it's documented to do. > > > > If you don't get any useful answers here, I'd suggest going to > > multiprocess module. > > > > -- > > DaveA -- http://mail.python.org/mailman/listinfo/python-list
Re: "python.exe has stopped working" when os.execl() runs on Windows 7
Probably a bug I suppose. :( I've used subprocess before and it works fine. I was just learning about the os module. os.execl() works if you provide no nulls, for example: os.execl('c:\\bin\\filename.exe','filename.exe','arg1') Is there the place to open a ticket for Python developers? Who keeps the os module? On Saturday, April 27, 2013 11:02:01 PM UTC-3, Dave Angel wrote: > On 04/27/2013 09:05 PM, cormog...@gmail.com wrote: > > > Yes, just those two lines cause the error. 'filename.exe' exists and runs > > ok in the command prompt. Any other executable cause the problem, also '', > > for example: > > > > > > os.execl('','') > > > > > > If doesn't work on Windows it should give an error message, right? > > > > > > > I'm not running Windows any more, so it's hard to be conclusive. When I > > saw the description, I just assumed it'd be problematic under Windows. > > That's why I had never played with it. By the time I escaped to Linux, > > I was used to subprocess, so I still never played with execl. But why > > you should get that error on a console program run from the cmd prompt, > > I have no idea. > > > > > > -- > > DaveA -- http://mail.python.org/mailman/listinfo/python-list
Re: "python.exe has stopped working" when os.execl() runs on Windows 7
I did that but unfortunately the 'bug' persists. :( I've chosen the os module because I though it would be more portable. :/ On Sunday, April 28, 2013 12:53:25 AM UTC-3, Nobody wrote: > On Sat, 27 Apr 2013 17:22:31 -0700, cormogram wrote: > > > > > Was trying os.execl() and got a "python.exe has stopped working" on my > > > Windows 7 Ultimate SP1 x64 desktop. > > > > > > I'm using Python 2.7.4 and that happens when the second arg is ''. For > > > example: > > > > > > os.execl('filename.exe','') > > > > Note that, by convention, the second argument should normally also be the > > filename (the second argument will be available to the program as > > argv[0]), e.g.: > > > > os.execl('filename.exe','filename.exe') > > > > If successful, the exec* functions don't return. On Unix, the new program > > replaces the existing program in the current process. IIRC, the Windows > > version executes the program in a child process then exit()s upon > > completion. > > > > The exec* functions probably shouldn't be used within a program which uses > > any of the more complex OS features (e.g. GUI), as they will block event > > processing, background threads, etc. -- http://mail.python.org/mailman/listinfo/python-list
Re: "python.exe has stopped working" when os.execl() runs on Windows 7
It works fine as long as you don't provide a null string ('') to os.execl(), such as: os.execl('filename.exe','') On Sunday, April 28, 2013 5:02:48 AM UTC-3, Fábio Santos wrote: > Cannot reproduce on windows 7 ultimate > > > > Steps taken: > > > > Start cmd > > cd to Desktop where I have a GUI application > > run python on the console > > import os > > os.execl('exe.exe', 'exe.exe') > > > > > > > > > > On Sun, Apr 28, 2013 at 8:51 AM, Terry Jan Reedy wrote: > > > On 4/27/2013 11:42 PM, cormog...@gmail.com wrote: > > > > > >> Is there the place to open a ticket for Python developers? > > > > > > > > > bugs.python.org > > > > > > > > > -- > > > http://mail.python.org/mailman/listinfo/python-list > > > > > > > > -- > > Fábio Santos -- http://mail.python.org/mailman/listinfo/python-list
Re: "python.exe has stopped working" when os.execl() runs on Windows 7
Thank you! On Sunday, April 28, 2013 4:51:03 AM UTC-3, Terry Jan Reedy wrote: > On 4/27/2013 11:42 PM, cormog...@gmail.com wrote: > > > > > Is there the place to open a ticket for Python developers? > > > > bugs.python.org -- http://mail.python.org/mailman/listinfo/python-list
Re: "python.exe has stopped working" when os.execl() runs on Windows 7
It isn't, but it doesn't matter because all executables I've tried cause the error, even "ping.exe". Just try: os.execl('ping.exe', '') And it will cause the "python.exe has stopped working" error message. On Sunday, April 28, 2013 5:05:02 AM UTC-3, Fábio Santos wrote: > Is this executable freely available, or something you can share? If > > you can send me that executable I can try to reproduce the bug with > > it. -- http://mail.python.org/mailman/listinfo/python-list