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

Here is a patch that corrects the problem (quoted below and attached.) This 
only corrects the problem when 'PyOS_ReadlineFunctionPointer' is set, e.g. you 
must 'import readline', otherwise Python will defer to stdin/stdout with 
'PyOS_StdioReadline'.


The patch:


--- Python-2.6.8/Parser/tokenizer.c     2012-04-10 11:32:11.000000000 -0400
+++ Python-2.6.8-patched/Parser/tokenizer.c     2012-07-23 19:56:39.645992101 
-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 : stdout, tok->prompt);
             if (tok->nextprompt != NULL)
                 tok->prompt = tok->nextprompt;
             if (newtok == NULL)


Kevin Barry

----------
keywords: +patch
status: open -> pending
Added file: 
http://bugs.python.org/file26491/Python-2.6.8-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