Differences between revisions 1 and 8 (spanning 7 versions)
Revision 1 as of 2008-11-12 18:16:34
Size: 555
Editor: cpe-075-182-091-179
Comment:
Revision 8 as of 2008-11-23 17:56:15
Size: 706
Editor: astound-69-42-4-166
Comment: mention array.ArrayType is available in 2.2
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
You can no longer do PyFile(inputStream) directly from Jython code. This is 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: * You can no longer do `PyFile`(inputStream) directly from Jython code. This is because a `PyFile` that gets an `InputStream` [INSERT REAL REASON], so that the recommended approach is to replace code like:
Line 5: Line 6:
fis = FileInputStream("error.txt")
pyf = PyFile(fis)
}}}
with code like:
Line 6: Line 11:
{{{
from java.io import FileInputStream
from org.python.core.util import FileUtil
Line 9: Line 17:
with code like:
{{{
from java.io import FileInputStream
from org.python.core.util import FileUtil
Line 14: Line 18:
fis = FileInputStream("error.txt")
pyf = FileUtil.wrap(fis)
}}}
* types.ArrayType has been removed as CPython never had it. Use array.ArrayTypes instead (which is available in both 2.2 and 2.5)

* The pre and xreadlines modules have been removed

* You can no longer do PyFile(inputStream) directly from Jython code. This is because a PyFile that gets an InputStream [INSERT REAL REASON], 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 = PyFile(fis)

with code like:

from java.io import FileInputStream
from org.python.core.util import FileUtil
fis = FileInputStream("error.txt")
pyf = FileUtil.wrap(fis)

* types.ArrayType has been removed as CPython never had it. Use array.ArrayTypes instead (which is available in both 2.2 and 2.5)

* The pre and xreadlines modules have been removed

Jython25BackwardsIncompatibilities (last edited 2008-11-23 17:56:15 by astound-69-42-4-166)