Ronald Oussoren added the comment:

I've just tested this on OSX 10.8.2 and the problem is not present there (that 
is, 'python -c "import deadline" &' does not hang)

The problem is present on OSX 10.6.8, and when using ksh(1) you can see why the 
process is stopped:

[1] + Stopped(SIGTTOU)         python -c 'import readline' &

That signal is generated when the program generates output to a tty and the 
TOSTOP option of stty is active.  Whether or not that option is active is OS 
configuration (and can be changed using the stty command).

Reading the option:

import termios
lflags = termios.tcgetattr(0)[3]
print (lflags & termios.TOSTOP) != 0

Oddly enough the option off on both OSX 10.6 and 10.8, which point to a bug in 
OSX 10.6 (or to a misunderstanding of low-level tty programming details on my 
part which would not be unlikely)

Anyway, there is an easy workaround: before importing readline add:

import signal
signal.signal(signal.SIGTTOU, signal.SIG_IGN)

This ignores the SIGTTOU option and allows me to import readline on the 
background.

IMHO This issue can be closed because this behavior is not a Python bug but a 
platform feature.

----------
resolution:  -> invalid
status: open -> pending

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

Reply via email to