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 emmanuel
Recipients Kevin.Barry, emmanuel, vstinner
Date 2013-03-18.22:11:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1363644678.88.0.560302588826.issue14916@psf.upfronthosting.co.za>
In-reply-to
Content
Kevin,

These are good points.

I had a cursory look at the python source code and observed the following:
- There may also be a concern with stderr (used to print the prompt in PyOS_Readline)
- PyOS_Readline has two different definitions in files pgenmain.c and myreadline.c
- There is this interesting comment in myreadline.c:
/* By initializing this function pointer, systems embedding Python can
   override the readline function.
   Note: Python expects in return a buffer allocated with PyMem_Malloc. */
char *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, char *);

This pointer is actually used (set it to (void*)1 and the interpreter crashes) so it could offer a means to redirect stdin as we want. For stdout/stderr further investigation is needed.
History
Date User Action Args
2013-03-18 22:11:19emmanuelsetrecipients: + emmanuel, vstinner, Kevin.Barry
2013-03-18 22:11:18emmanuelsetmessageid: <1363644678.88.0.560302588826.issue14916@psf.upfronthosting.co.za>
2013-03-18 22:11:18emmanuellinkissue14916 messages
2013-03-18 22:11:18emmanuelcreate