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
Date 2012-07-24.15:46:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1343144788.1.0.0170868816709.issue14916@psf.upfronthosting.co.za>
In-reply-to
Content
The patch from before needed a slight modification for when Python actually defaults to an interactive session on stdin. Since I rebuild this for my current distro (Slackware64 13.37,) I switched to the Python 2.6.6 source. This might not be the proper way to handle the default case (e.g. 'Py_Main'), but it's a start.


The patch (also attached):

--- ./Parser/tokenizer.c.orig   2012-07-23 22:24:56.513992301 -0400
+++ ./Parser/tokenizer.c        2012-07-23 22:23:24.329992167 -0400
@@ -805,7 +805,7 @@
             return Py_CHARMASK(*tok->cur++);
         }
         if (tok->prompt != NULL) {
-            char *newtok = PyOS_Readline(stdin, stdout, tok->prompt);
+            char *newtok = PyOS_Readline(tok->fp? tok->fp : stdin, (tok->fp && tok->fp != stdin)? tok->fp : stdout, tok->prompt);
             if (tok->nextprompt != NULL)
                 tok->prompt = tok->nextprompt;
             if (newtok == NULL)


Kevin Barry
History
Date User Action Args
2012-07-24 15:46:28Kevin.Barrysetrecipients: + Kevin.Barry
2012-07-24 15:46:28Kevin.Barrysetmessageid: <1343144788.1.0.0170868816709.issue14916@psf.upfronthosting.co.za>
2012-07-24 15:46:27Kevin.Barrylinkissue14916 messages
2012-07-24 15:46:27Kevin.Barrycreate