[New-bugs-announce] [issue14892] 'import readline' fails when launching with '&'

olivier-mattelaer report at bugs.python.org
Wed May 23 20:55:19 CEST 2012


New submission from olivier-mattelaer <olivier.mattelaer at uclouvain.be>:

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

----------
assignee: ronaldoussoren
components: Macintosh
messages: 161450
nosy: olivier-mattelaer, ronaldoussoren
priority: normal
severity: normal
status: open
title: 'import readline' fails when launching with '&'
type: crash
versions: Python 2.6, Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14892>
_______________________________________


More information about the New-bugs-announce mailing list