Message9221

Author jeff.allen
Recipients jeff.allen
Date 2014-11-27.21:18:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1417123127.21.0.831044900543.issue2234@psf.upfronthosting.co.za>
In-reply-to
Content
http://permalink.gmane.org/gmane.comp.lang.jython.user/10517

This user has wrapped the InteractiveConsole in a BeanShell widget that supplies console streams with java.io.Reader/Writer interfaces. He is able to type in Chinese on these streams. In Jython 2.2, the print command would echo a literal string containing Chinese characters as typed. Since 2.5 this has been possible and the work we did on the Jython console in 2.7 has not restored the expected behaviour.

Looking at the user's code and our source I estimate the problem is with the stream-handling in class PythonInterpreter, or perhaps withthe way PyFileReader supports it. 16 bit characters are being accepted here as the content of a PyString, then mishandled.

Part of the problem here is not using the unicode type. However, there is also a bug in Jython.

The fix for #2037 will help, in that the content check on PyString would raise an error in this case, but it doesn't fix the problem that character text in being treated as bytes.

There may be a work-around by avoiding the Reader/Writer interface to PythonInterpreter and working only with encoded text as bytes.
History
Date User Action Args
2014-11-27 21:18:47jeff.allensetrecipients: + jeff.allen
2014-11-27 21:18:47jeff.allensetmessageid: <1417123127.21.0.831044900543.issue2234@psf.upfronthosting.co.za>
2014-11-27 21:18:47jeff.allenlinkissue2234 messages
2014-11-27 21:18:45jeff.allencreate