[Patches] [ python-Patches-402891 ] Alternative readline module

noreply@sourceforge.net noreply@sourceforge.net
Thu, 09 Aug 2001 08:58:30 -0700


Patches item #402891, was opened at 2000-12-17 14:22
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=402891&group_id=5470

Category: Modules
Group: None
Status: Open
>Resolution: Out of Date
>Priority: 3
Submitted By: Neil Schemenauer (nascheme)
Assigned to: Neil Schemenauer (nascheme)
Summary: Alternative readline module

Initial Comment:
 

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

>Comment By: Guido van Rossum (gvanrossum)
Date: 2001-08-09 08:58

Message:
Logged In: YES 
user_id=6380

I have several problems with the patch at
http://arctrix.com/nas/python/edline.diff:

- Is it still needed now that we've solved the GPL
compatibility problems of the Python license?

- It's out of date (patches Setup.dist instead of setup.py)

- It generates compilation errors and warnings:

../Modules/edline.c:74: warning: function declaration isn't
a prototype
../Modules/edline.c:418: warning: function declaration isn't
a prototype
../Modules/edline.c:467: parse error before `__extension__'
../Modules/edline.c:467: `__len' undeclared here (not in a
function)
../Modules/edline.c:467: initializer element is not constant
../Modules/edline.c:467: parse error before `if'
../Modules/edline.c:467: warning: type defaults to `int' in
declaration of `__retval'
../Modules/edline.c:467: conflicting types for `__retval'
../Modules/edline.c:467: previous declaration of `__retval'
../Modules/edline.c:467: warning: data definition has no
type or storage class
../Modules/edline.c:467: parse error before `}'
../Modules/edline.c:477: warning: function declaration isn't
a prototype
../Modules/edline.c: In function `search_hist':
../Modules/edline.c:482: warning: function declaration isn't
a prototype
../Modules/edline.c: At top level:
../Modules/edline.c:844: warning: function declaration isn't
a prototype
make: *** [Modules/edline.o] Error 1

Marked Out of date and lowered priority.

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

Comment By: Martin v. Löwis (loewis)
Date: 2001-06-04 01:00

Message:
Logged In: YES 
user_id=21627

I see this patch is still not committed. Any reason why 
not?


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

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-01-18 16:04

Message:
Neil, I'm assigning this back to you and reopening it (from Accepted).  

It seems patches with status Accepted frequently get lost -- probably because "My Patches" doesn't show them.

In any case, I think you should just check this in ASAP and close the patch!


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

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-01-16 06:59

Message:
Ah, of course.  I saw that, even played with it a bit.

Looks cool, but I don't know about using it to replace readline.

But you might want to change the name given that pyrl is already taken. ;-)


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

Comment By: Michael Hudson (mwh)
Date: 2001-01-16 06:34

Message:
pyrl is my line reader written in Python that I've been intermittently blathering about on python-dev:

http://www-jcsu.jesus.cam.ac.uk/~mwh21/hacks/pyrl-0.2.0.tar.gz

it's still very experimental, though.

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-01-16 05:41

Message:
What's pyrl in this context?  A Google search turns up a bunch of references to a Perl preprocessor that takes Pythonic syntax and translates it into Perl. :-)

[ESR replied Neil via email: "I'm on it.  Gotta ship my PC9 paper first, though."]


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

Comment By: Michael Hudson (mwh)
Date: 2001-01-16 02:23

Message:
You could defer the decision between readline and edline until runtime, as in: (will sf mangle this? we'll see)

Index: Modules/main.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/main.c,v
retrieving revision 1.47
diff -c -r1.47 main.c
*** Modules/main.c      2000/12/15 22:00:54     1.47
--- Modules/main.c      2001/01/16 10:19:45
***************
*** 267,274 ****
            isatty(fileno(stdin))) {
                PyObject *v;
                v = PyImport_ImportModule("readline");
!               if (v == NULL)
                        PyErr_Clear();
                else
                        Py_DECREF(v);
        }
--- 267,280 ----
            isatty(fileno(stdin))) {
                PyObject *v;
                v = PyImport_ImportModule("readline");
!               if (v == NULL) {
                        PyErr_Clear();
+                       v = PyImport_ImportModule("edline");
+                       if (v == NULL)
+                               PyErr_Clear();
+                       else
+                               Py_DECREF(v);
+               }
                else
                        Py_DECREF(v);
        }

(and pyrl's not going to be ready for 2.1, by a country mile...)


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

Comment By: Neil Schemenauer (nascheme)
Date: 2001-01-15 21:30

Message:
Hmm, I still like pyrl better.  What to do about GNU
readline now that its in Setup.conf?  You can't enable
them both and I don't feel comfortable enough with
autoconf to fix things.  ESR, if you could add the magic
to test for termios that would be cool.  configure should
use readline if its there and fall back to edline if 
termios is available.

Feel free to bounce it back to me if you don't have time.

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-01-03 06:10

Message:
Neil, this has now status Accepted.  Go ahead and check it in!


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

Comment By: Guido van Rossum (gvanrossum)
Date: 2000-12-18 14:17

Message:
Neil, I propose that you check this in.

The edline.c file would need a little work to compile without warnings, and you should add #HAVE_STRDUP to edline.h (Python makes sure strdup() is always present).

The comment for Setup.dist "Neil Schemenauer's edline library" sounds a little strange given that most of the code is by others. Maybe "Neil Schemenauer's edline wrapper module"?

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

Comment By: Neil Schemenauer (nascheme)
Date: 2000-12-17 14:28

Message:
I like Michael Hudson's idea of writing a readline
replacement in Python using modules like _curses and termios
better but I had this patch 90% complete before I recieved
his email.  I stripped the editline library down and updated
it for modern Unix systems.  I have no idea if it compiles
on anything other than Linux however.

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

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