This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rnk
Recipients rnk, ronaldoussoren
Date 2009-08-29.03:19:44
SpamBayes Score 3.6170233e-11
Marked as misclassified No
Message-id <1251515988.29.0.608870203555.issue6800@psf.upfronthosting.co.za>
In-reply-to
Content
The test case is attached.  On Mac OS X (and presumably FreeBSD, which
has the same behavior) when you try to exec from a process that has any
other threads in it, you get an OSError, "Operation not supported". 
Here's the output on my MacBook:

Traceback (most recent call last):
  File "daemon_exec.py", line 16, in <module>
    main()
  File "daemon_exec.py", line 13, in main
    os.execl('echo', 'hello world')
  File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/os.py",
line 312, in execl
    execv(file, args)
OSError: [Errno 45] Operation not supported

And on my Linux box:

hello world

Here's a similar bug that OCaml had to deal with:
http://caml.inria.fr/mantis/view.php?id=4666

I think it's reasonable for Python to declare this to be a limitation of
the OS, but considering that the other thread could be a daemon thread
that the user doesn't really care about, I think it would be reasonable
for Python to kill the other threads in the process before execing. 
That's what happens on Linux, anyway.

I ran into this problem while trying to add a persistent background
compilation thread to unladen swallow, and wondered if having any other
threads would trigger the same exception.

It's tempting to just write this off, but I figured it should be
documented or left open as a low priority defect.
History
Date User Action Args
2009-08-29 03:19:48rnksetrecipients: + rnk, ronaldoussoren
2009-08-29 03:19:48rnksetmessageid: <1251515988.29.0.608870203555.issue6800@psf.upfronthosting.co.za>
2009-08-29 03:19:46rnklinkissue6800 messages
2009-08-29 03:19:45rnkcreate