From: Robin B. <ro...@re...> - 2009-02-24 14:19:03
|
There is an incompatibility between jython's cStringIO and Python's. Jython's cStringIO also differs from its own StringIO. Basically when run in jython this script truncates the output of getvalue (because of the prior seek and write). ####### tstringio.py from cStringIO import StringIO out=StringIO() out.write('a'*28000) out.seek(18352-8) out.write('b'*8) s= out.getvalue() print len(s), s[-10:] > C:\jython2.5b1\rl-jython25\tmp>jython tstringio.py > 18352 aabbbbbbbb > > C:\jython2.5b1\rl-jython25\tmp>tstringio.py > 28000 aaaaaaaaaa If cStringIO is changed to StringIO then jython behaves like python -- Robin Becker |