Kevin Barry <ta0k...@gmail.com> added the comment:

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

----------
Added file: 
http://bugs.python.org/file26501/Python-2.6.6-Run_Interactive-fix.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14916>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to