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 Kevin.Barry
Recipients Kevin.Barry, emmanuel, vstinner
Date 2013-03-25.23:59:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>

The Python interpreter isn't reentrant, so you could only run two interactive sessions connected to the same Python environment if you implemented your own REPL function that unlocked the GIL when waiting for input, then lock it just long enough to interpret the input.

Also, the readline module already does what you suggest (sets PyOS_ReadlineFunctionPointer to a GNU libreadline wrapper.) My "readline hack" (working.c) forces it to behave as it's supposed to. Rather, it *undoes* what PyRun_InteractiveLoop does every iteration, which is pass stdin/stdout for I/O, which libreadline in turn uses.

I agree that it would be nice to get a Python developer involved, mostly because I expect things to break when this problem is fixed. Bad things happen when you think you've tested a lot of different cases that actually turn out to be the exact same case.

Kevin Barry
Date User Action Args
2013-03-25 23:59:03Kevin.Barrysetrecipients: + Kevin.Barry, vstinner, emmanuel
2013-03-25 23:59:03Kevin.Barrysetmessageid: <>
2013-03-25 23:59:03Kevin.Barrylinkissue14916 messages
2013-03-25 23:59:03Kevin.Barrycreate