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 <1364255943.8.0.562190447076.issue14916@psf.upfronthosting.co.za>
In-reply-to
Content
emmanuel,

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
History
Date User Action Args
2013-03-25 23:59:03Kevin.Barrysetrecipients: + Kevin.Barry, vstinner, emmanuel
2013-03-25 23:59:03Kevin.Barrysetmessageid: <1364255943.8.0.562190447076.issue14916@psf.upfronthosting.co.za>
2013-03-25 23:59:03Kevin.Barrylinkissue14916 messages
2013-03-25 23:59:03Kevin.Barrycreate