Author olivier-mattelaer
Recipients olivier-mattelaer, ronaldoussoren
Date 2012-05-23.18:55:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1337799319.38.0.727886103909.issue14892@psf.upfronthosting.co.za>
In-reply-to
Content
Hi Everyone, 

I have found a strange behavior of the import command for the routine readline:

The commands (put in the file test.py) is simply:
import readline
print readline.__doc__

If I run this programs "normally" (i.e. python2.x test.py) everything runs normally:
[tmp]$ python2.7 tmp.py 
Importing this module enables command line editing using GNU readline.

But if I launched it in the following way:
python2.X test.py &
It's stops before finishing the import command (so no output even if I print the output into a file). 
This doesn't raise any error just stop the program.

I tried to add a try...except...finally... but even the finally statement is not executed.

Of course, I realize that readline is not that interesting to load with that options. So I would be more than happy if you could indicate me a way to either detect that the user launch the program with '&' or a way to avoid readline to stop the program in this situations.

Thanks a lot,

Olivier
History
Date User Action Args
2012-05-23 18:55:19olivier-mattelaersetrecipients: + olivier-mattelaer, ronaldoussoren
2012-05-23 18:55:19olivier-mattelaersetmessageid: <1337799319.38.0.727886103909.issue14892@psf.upfronthosting.co.za>
2012-05-23 18:55:18olivier-mattelaerlinkissue14892 messages
2012-05-23 18:55:18olivier-mattelaercreate