From: <bc...@wo...> - 2002-01-05 22:07:40
|
[Steve Cohen] >There is a stack trace and it's the same whether or not >showJavaExceptions is true: That is OK. Thanks. >[scohen@sleepingbear scohen]$ jython >-Dpython.options.showJavaExceptions=3Dtrue >Jython 2.1 on java1.3.0 (JIT: null) >Type "copyright", "credits" or "license" for more information. >>>> import dbexts, isql >>>> d=3Ddbexts.dbexts("prod_sport") >>>> D=3Disql.IsqlCmd(d) >>>> D.use_rawinput=3D0 >>>> D.cmdloop() >Traceback (innermost last): > File "<console>", line 1, in ? > File "/usr/local/jython/jython-2.1/Lib/cmd.py", line 79, in cmdloop >TypeError: write(): 1st arg can't be coerced to String Not quite the error situation that I expected, but that just goes to show how important the context is. I have added a bug report about the situation. >The 1st arg is None, which is arguably a bug in isql.IsqlCmd. Are you absolutely sure that self.prompt is None. AFAICT D.prompt should be an instance of the Prompt class and that will cause the stacktrace above. A None value will cause a NPE which is a different bug. Please recheck the value of D.prompt. >The code >in cmdloop can't handle it (can't coerce it to String). I can work >around the bug by explicitly setting D.prompt (which is the first >argument passed in) before executing D.cmdloop() but then you are quite >right, there still isn't support for any form of readline, either the >java_readline that is in the interactive mode or even the Ctrl-N, Ctrl-P >stuff that the documentation speaks of. > >I suppose I could take a look at fixing this, although I'm not extremely >familiar with it. If you could point me to where the java_readline >stuff is integrated into the interactive mode, I could have a go at it. That code is located in org\python\util\ReadlineConsole.java. >Or, if you'd rather have someone more familiar with the internals do it, >I certainly understand. Well, I prefer that it is implemented by someone who really want it to work. If you decide to try, feel free to ask questions and seek advice on jython-dev. regards, finn |