Issue2602

classification
Title: NumberFormatException in terminal on OSX 10.12.5 (ncurses related)
Type: behaviour Severity: normal
Components: Versions: Jython 2.7
Milestone: Jython 2.7.2
process
Status: pending Resolution: fixed
Dependencies: Superseder:
Assigned To: stefan.richthofer Nosy List: stefan.richthofer, zyasoft
Priority: normal Keywords:

Created on 2017-07-02.15:39:45 by stefan.richthofer, last changed 2017-07-05.15:02:34 by stefan.richthofer.

Messages
msg11457 (view) Author: Stefan Richthofer (stefan.richthofer) Date: 2017-07-02.15:39:44
I was pointed to this issue in JyNI context, but it seems to be JyNI-unrelated.
On OSX macOS Sierra 10.12.5 / Oracle Java 1.8.0_131 / Jython 2.7.1 RC2/RC3/Final, using the terminal:

[ERROR] Failed to construct terminal; falling back to unsupported
java.lang.NumberFormatException: For input string: "0x100"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Integer.valueOf(Integer.java:766)
at org.python.jline.internal.InfoCmp.parseInfoCmp(InfoCmp.java:59)
at org.python.jline.UnixTerminal.parseInfoCmp(UnixTerminal.java:242)
at org.python.jline.UnixTerminal.<init>(UnixTerminal.java:65)
at org.python.jline.UnixTerminal.<init>(UnixTerminal.java:50)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at org.python.jline.TerminalFactory.getFlavor(TerminalFactory.java:211)
at org.python.jline.TerminalFactory.create(TerminalFactory.java:102)
at org.python.jline.TerminalFactory.get(TerminalFactory.java:186)
at org.python.jline.TerminalFactory.get(TerminalFactory.java:192)
at org.python.jline.console.ConsoleReader.<init>(ConsoleReader.java:243)
at org.python.util.JLineConsole.install(JLineConsole.java:107)
at org.python.core.Py.installConsole(Py.java:1745)
at org.python.core.PySystemState.initConsole(PySystemState.java:1269)
at org.python.core.PySystemState.doInitialize(PySystemState.java:1119)
at org.python.core.PySystemState.initialize(PySystemState.java:1033)
at org.python.core.PySystemState.initialize(PySystemState.java:989)
at org.python.core.PySystemState.initialize(PySystemState.java:984)
at org.python.util.jython.run(jython.java:263)
at org.python.util.jython.main(jython.java:142)

(Not showing up in xcode IDE.)


The issue is known in different context:
https://stackoverflow.com/a/44329833

A suggested workaround is to set the environment variable TERM to a dfifferent value than "xterm-256color".
(Apparrently, newer ncurses displays 256 as 0x100 for better readability.)

This is said to be fixed in recent JLine2. So maybe another update of JLine2 can solve this issue in Jython.
msg11466 (view) Author: Stefan Richthofer (stefan.richthofer) Date: 2017-07-05.15:02:33
Fixed as of https://hg.python.org/jython/rev/206a7a2b3aa5.
History
Date User Action Args
2017-07-05 15:02:34stefan.richthofersetstatus: open -> pending
assignee: stefan.richthofer
resolution: fixed
messages: + msg11466
versions: + Jython 2.7
2017-07-02 15:39:45stefan.richthofercreate