Message669

Author bab
Recipients
Date 2002-06-23.14:56:55
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Hi.  If you're using a readline console and you enter
a blank line (such as when you end an indented block
in a for loop, etc), ReadlineConsole returns a null input
string and jython breaks with an error.

This all seems to happen because the java-readline wrappers
return null if an empty string was input.

A patch that fixes this problem is shown below.  The bug
was originally reported as #145613 in the Debian BTS
(http://bugs.debian.org/145613).

Thanks - Ben.

--- jython-2.1.0.orig/org/python/util/ReadlineConsole.java
+++ jython-2.1.0/org/python/util/ReadlineConsole.java
@@ -39,7 +39,8 @@
      **/
     public String raw_input(PyObject prompt) {
         try {
-           return Readline.readline(prompt==null ? "" : prompt.toString());
+           String line = Readline.readline(prompt==null ? "" : prompt.toString());
+           return (line == null ? "" : line);
         } catch (java.io.EOFException eofe) {
            throw new PyException(Py.EOFError);
         } catch (java.io.IOException e) {
History
Date User Action Args
2008-02-20 17:17:06adminlinkissue572769 messages
2008-02-20 17:17:06admincreate