[issue9148] os.execve puts process to background on windows

2018-09-18 Thread Thomas Sibley


Thomas Sibley  added the comment:

Thanks for taking the time to explain.  I was just discovering the same myself 
experimentally.  The MS docs I linked to seem a little misleading. orz

In that case, do you think a doc patch for os.exec* adding a more nuanced take 
on Windows support would be considered?  I'd be glad to write it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9148] os.execve puts process to background on windows

2018-09-18 Thread Eryk Sun


Eryk Sun  added the comment:

nt.execv[e] wraps calling the C runtime _wexecv[e] function. The other os.exec* 
functions are in turn based on these calls. As to spawn, for Windows _P_OVERLAY 
just means to exit the current process. The source code is published, so you 
can see how simple the implementation is in ucrt\exec\spawnv.cpp:

if (mode == _P_OVERLAY)
{
// Destroy ourselves:
_exit(0);
}

If I recall correctly, in the early 80s, Microsoft's C runtime was used for 
both MS-DOS and Xenix (Unix) development. One assumes that the overlay option 
was actually useful in Xenix.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9148] os.execve puts process to background on windows

2018-09-18 Thread Thomas Sibley


Thomas Sibley  added the comment:

It seems like it would be very nice to provide compat if its possible with a 
minimum of effort.

At the very least, a doc patch to os.exec*() seems warranted.  I expected to 
find notes on platform compat in the doc and was pleasantly surprised to see 
the indication of Windows support!  Only later did I find out that it is not 
meaningfully supported.  :-(

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9148] os.execve puts process to background on windows

2018-09-18 Thread Thomas Sibley


Thomas Sibley  added the comment:

What about using _execv*() and friends, as documented at 
?

They appear to use the process overlay feature of _spawnv*() et al., as 
described at 

 and 
.

--
type: behavior -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9148] os.execve puts process to background on windows

2018-09-18 Thread Eryk Sun


Eryk Sun  added the comment:

Python doesn't go out of its way to fake a cross-platform POSIX environment in 
Windows, complete with emulated fork and exec. I don't recommend using 
nt.execv[e] or the os.exec* functions in Windows. Their behavior is almost 
always undesired. I'd be in favor of deprecating them and eventually removing 
them. Use subprocess instead.

--
nosy: +eryksun
resolution:  -> third party
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9148] os.execve puts process to background on windows

2018-09-18 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9148] os.execve puts process to background on windows

2018-09-18 Thread Thomas Sibley


Change by Thomas Sibley :


--
nosy: +trs

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9148] os.execve puts process to background on windows

2014-06-19 Thread Mark Lawrence

Mark Lawrence added the comment:

I've changed the nosy list according to the experts index for the os module and 
Windows, sorry if I've named anyone I shouldn't have.

--
nosy: +BreamoreBoy, loewis, steve.dower, tim.golden, zach.ware

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9148
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9148] os.execve puts process to background on windows

2013-08-04 Thread Piotr Dobrogost

Changes by Piotr Dobrogost p...@bugs.python.dobrogost.net:


--
nosy: +piotr.dobrogost

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9148
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9148] os.execve puts process to background on windows

2013-08-04 Thread Matt Joiner

Changes by Matt Joiner anacro...@gmail.com:


--
nosy: +anacrolix

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9148
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9148] os.execve puts process to background on windows

2013-08-04 Thread Piotr Dobrogost

Piotr Dobrogost added the comment:

This is unexpected and makes people wonder what's going on. See 
http://stackoverflow.com/q/7004687/95735 and 
http://stackoverflow.com/q/7264571/95735.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9148
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9148] os.execve puts process to background on windows

2012-08-26 Thread R. David Murray

R. David Murray added the comment:

This looks like the answer to the cygwin question, assuming things haven't 
changed:

http://cygwin.com/ml/cygwin-developers/2001-02/msg00106.html

Basically, it does the same thing as Python, except that a special return code 
is reported by the execing process to signal to whoever created the execing 
process that an exec has occurred.

Would it be at all useful to add such a return code?

--
nosy: +r.david.murray
versions: +Python 3.4 -Python 2.6, Python 2.7, Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9148
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9148] os.execve puts process to background on windows

2010-07-16 Thread Eric Smith

Eric Smith e...@trueblade.com added the comment:

I believe it's true that Windows does not offer process replacement. I'm sure 
you could perform some tricks by essentially writing your own loader, but the 
practical answer is no. It might be worth looking into how cygwin implements 
exec().

--
nosy: +eric.smith

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9148
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9148] os.execve puts process to background on windows

2010-07-03 Thread anatoly techtonik

New submission from anatoly techtonik techto...@gmail.com:

os.execve() is said to replace current process with new program. Unfortunately, 
when you try to call script that contains os.execve() on windows - that script 
spawns background process and control is immediately returned to the calling 
program. Does it behave the same on Unix?

Is there any way to replace current process on Windows so that references to 
calling parent process are not lost and it could wait for execution to complete?

--
components: Library (Lib)
messages: 109176
nosy: techtonik
priority: normal
severity: normal
status: open
title: os.execve puts process to background on windows
versions: Python 2.6, Python 2.7, Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9148
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9148] os.execve puts process to background on windows

2010-07-03 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

on Windows, exec() does not really replace the current process. It creates a 
new process (with a new pid), and exits the current one.

Hence the calling program only sees that the script has terminated.

I don't see any easy solution on Windows, except than using subprocess.Popen(), 
and exit the script when the subprocess terminates.

--
nosy: +amaury.forgeotdarc

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9148
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9148] os.execve puts process to background on windows

2010-07-03 Thread anatoly techtonik

anatoly techtonik techto...@gmail.com added the comment:

Does that mean that windows doesn't allow process replacement at all?

I remember the time then game NoCD loaders were somehow able to load, patch and 
execute main program in their address space.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9148
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com