[Patches] [ python-Patches-955928 ] use PyOS_ReadlineFunctionPointer in non-interractive input

SourceForge.net noreply at sourceforge.net
Thu Aug 5 13:21:17 CEST 2004


Patches item #955928, was opened at 2004-05-18 14:41
Message generated for change (Comment added) made by mwh
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=955928&group_id=5470

Category: Parser/Compiler
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Gregory Lielens (greglielens)
Assigned to: Michael Hudson (mwh)
Summary: use PyOS_ReadlineFunctionPointer in non-interractive input 

Initial Comment:
Extend the control provided by
PyOS_ReadlineFunctionPointer to non-interractive
inputs. In addition, initialize
PyOS_ReadlineFunctionPointer to the default input
function, so that it can be retrieved by extern code
(allowing for embedding the old input function and
modifying it). Readline Module changed accordingly
(only modify PyOS_ReadlineFunctionPointer to
call_readline if input is interractive).
This was neccessary to modify the input behavior of
PyRun_InteractiveLoop, in case input is not interractive...
The application is a python driven parallel framework
using MPI, where the interractive process broadcast the
input lines to the non-interractive processes, who
listen...but other applications may benefit also.
patched: Modules/readline.c
               Parser/myreadline.c

----------------------------------------------------------------------

>Comment By: Michael Hudson (mwh)
Date: 2004-08-05 12:21

Message:
Logged In: YES 
user_id=6656

Uh, no, scratch that: I think your attempt to upload a new
patch failed.  Try again?

----------------------------------------------------------------------

Comment By: Michael Hudson (mwh)
Date: 2004-08-05 12:11

Message:
Logged In: YES 
user_id=6656

A chance, yes.  I'm a bit loath to change this, as I have no
idea why things were done this way in the first place.  If
it's the traditional "no good reason", then I guess this can
go in...

Also, I think your patch is backwards and doesn't adhere to
the local style wrt tabs and spaces.

----------------------------------------------------------------------

Comment By: Gregory Lielens (greglielens)
Date: 2004-08-05 08:56

Message:
Logged In: YES 
user_id=1044428

I updated the patch to python current CVS, and do similar
modification in /Python/bltinmodule.c for builtin_raw_input
fonction.
builtin_raw_input now call PyOS_Readline when  stdin and
stdout objects are file, regardless if they are tty or not.
This one was forgotten in the first version of the patch,
and is needed to be able to use the same broadcasting
technique for parrallel interractive session when using
IPython. I now think that all functions implementing
possibly interractive input have been patched...
All regression tests pass except test_grp and test_pwd, but
those fail exactly the same way (KeyError) with non-patched
cvs...
Any chance to have this considered for 2.4?
Regards,
Greg.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=955928&group_id=5470


More information about the Patches mailing list