From: Frank W. <fwi...@gm...> - 2008-11-12 18:20:35
|
Hi all, modjy is having trouble with PyFile -- see http://bugs.jython.org/issue1171. I remember Charlie (and maybe Leo?) had done some work with PyFile, and at some point modified it so that you can no longer do PyFile(inputStream) directly from Jython code. If I remember correctly, this was because a PyFile that gets an inputStream needs to know the encoding of the stream in order to work, so that the recommended approach is to replace code like: from java.io import FileInputStream from org.python.core import PyFile fis = FileInputStream("error.txt") pyf = FileUtil.wrap(fis) with code like: from java.io import FileInputStream from org.python.core.util import FileUtil fis = FileInputStream("error.txt") pyf = FileUtil.wrap(fis) We should definitely work up a document that describes all of the backwards incompatibilities that our new treatment of encodings is going to produce. I've started a wiki page with the above at http://wiki.python.org/jython/Jython25BackwardsIncompatibilities. Am I correct about the details here? -Frank |