From: Jim W. <ji...@pa...> - 2009-07-27 20:47:58
|
I've looked a little at the PySystemState and PyFile stuff, and I could whip up a PyFileReader like PyFileWriter to handle input if you like. I'm not totally clear on what's happening with character encodings though (which I think may be a reason to keep PyFileWriter & Reader). Also I see both std{in, out, err} and __std{in, out, err}__ in PySystemState. It seems that the __ versions are obsolete? Or do they have a particular purpose? Jim Nicholas Riley wrote: > In article <4A6...@pa...>, > Jim White <ji...@pa...> wrote: > > >>I just tried out the JSR-223 engine in the 2.5 trunk and it works dandy >>(handling both statements and expressions - yay!) except that it doesn't >>handle the I/O part of the API. >> >>I opened an issue and included a quickie patch to implement output. If >>more help is needed to get this fixed, then just let me know. >> >>http://bugs.jython.org/issue1408 > > > I've checked in the stderr/stdout redirection but I haven't yet had a > chance to write tests for it. This once again runs into the issue that > the NIO-enabled Jython I/O system really does not want char-oriented I/O > coming from Java any more. There's only PyFileWriter, which was > removed, then was restored for backwards compatibility and is now > deprecated. > > If JSR 223 requires it, maybe we should un-deprecate this path (while > still recommending against its use for optimal performance) and > incorporate something equivalent on the reading side via > PythonInterpreter.setIn(), perhaps using your ReaderInputStream. I'm > not terribly familiar with the issues surrounding Java I/O, though. |