telmich <nico-bugs.python....@schottelius.org> added the comment:

You are right, there is no different behaviour as parent or child in general.

I used this example python => shell => python, because it is actually being 
used like this in cdist (first link in the first post).

The problem arises there, because python is called many (some thousand) times, 
depending on the configuration, thus you see the problem very often.

This is indeed a general problem, but you cannot easily trigger it in one 
python process, because the race condition is hard to trigger manually.

Thus the provided use case (running python 1000 times from shell scripts) is 
very realistic in a typical cdist run.

For demonstration, you can run ./shellpart.sh directly, press ctrl-c and see 
that you'll get a traceback, although all possible code is protected from the 
exception.

But (in that's the point) it is possible in user code to catch this exception.

I should probably rephrase the title to

"It is impossible to catch sigint on startup in python code"

Hope this makes things more clear.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14228>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to