[issue16822] execv (et al.) should invoke atexit handlers before executing new code

2018-07-08 Thread Tal Einat


Tal Einat  added the comment:

Seems like a decision needs to be made: Add support for `atexec` handlers, 
close this issue, or something else?

--

___
Python tracker 

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



[issue16822] execv (et al.) should invoke atexit handlers before executing new code

2018-07-06 Thread Ned Batchelder


Ned Batchelder  added the comment:

Coverage.py is registering a handler to save data before the program ends.  The 
execv call is not in the coverage.py code, it's in the program that coverage.py 
is running.

--

___
Python tracker 

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



[issue16822] execv (et al.) should invoke atexit handlers before executing new code

2018-07-06 Thread Tal Einat


Tal Einat  added the comment:

> we could definitely have a separate "atexec" handler

Couldn't coverage.py and similar apps can just invoke the atexit handlers 
before calling os.execv() or similar?  If so, perhaps a mention of this in the 
docs would suffice?

--
nosy: +taleinat

___
Python tracker 

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



[issue16822] execv (et al.) should invoke atexit handlers before executing new code

2018-07-03 Thread Eric Snow


Change by Eric Snow :


--
nosy: +emilyemorehouse, eric.snow

___
Python tracker 

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



[issue16822] execv (et al.) should invoke atexit handlers before executing new code

2013-01-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I agree with Charles-François, this is a too risky change.
However, we could definitely have a separate atexec handler, like the 
atfork handlers which are proposed in issue16500.

--

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



[issue16822] execv (et al.) should invoke atexit handlers before executing new code

2012-12-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

That's a good question. Conceptually it makes sense, but I wonder if programs 
currently rely on os.execv not cleaning up anything: not only it doesn't call 
atexit handlers, but it also doesn't try to shutdown the interpreter. Which can 
be handy if you are using exec() in a fork() + exec() context (I think it is 
generally recommended to use os._exit(), not sys.exit() in a forked child).

--
nosy: +neologix, pitrou
type:  - enhancement
versions: +Python 3.4 -Python 2.7, Python 3.3

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



[issue16822] execv (et al.) should invoke atexit handlers before executing new code

2012-12-31 Thread Georg Brandl

Georg Brandl added the comment:

FTR, with C's atexit(3), the handlers are not called either on exec().

--
nosy: +georg.brandl

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



[issue16822] execv (et al.) should invoke atexit handlers before executing new code

2012-12-31 Thread Charles-François Natali

Charles-François Natali added the comment:

The first reason for not calling atexit handlers upon exec() is that
it wouldn't be async-safe anymore, and could result in deadlocks.
Also, since atexit handlers are inherited upon fork(), running atexit
handlers upon exec() could result in such handlers being called
several times - something which should definitely be avoided.

Note that the atexit documentation states that handlers will only be
called in case of normal interpreter termination.

So I'm -1 on the change, the chance of breaking existing applications
is way too high.

--

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



[issue16822] execv (et al.) should invoke atexit handlers before executing new code

2012-12-30 Thread Ned Batchelder

New submission from Ned Batchelder:

If I register an atexit handler, and then call os.execv, the handler is not 
invoked before my process changes over to the new program.  Shouldn't it be?  
My program is ending, so my atexit handlers should be invoked.

This is based on this coverage.py bug:  
https://bitbucket.org/ned/coveragepy/issue/43/coverage-measurement-fails-on-code
  If the atexit handlers were invoked as part of os.execv, it would work 
properly.

--
messages: 178623
nosy: nedbat
priority: normal
severity: normal
status: open
title: execv (et al.) should invoke atexit handlers before executing new code
versions: Python 2.7, Python 3.3

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