Index: jython/org/python/core/PyString.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyString.java,v retrieving revision 2.60 diff -c -r2.60 PyString.java *** jython/org/python/core/PyString.java 6 Nov 2002 08:15:21 -0000 2.60 --- jython/org/python/core/PyString.java 18 Dec 2002 21:08:19 -0000 *************** *** 1013,1026 **** while (index < n && !Character.isWhitespace(chars[index])) index++; list.append(new PyString(string.substring(start, index))); splits++; } ! if (index < n) { ! while (index < n && Character.isWhitespace(chars[index])) ! index++; ! list.append(new PyString(string.substring(index, n))); ! } return list; } --- 1013,1027 ---- while (index < n && !Character.isWhitespace(chars[index])) index++; + if (index == n) + break; list.append(new PyString(string.substring(start, index))); splits++; } ! while (index < n && Character.isWhitespace(chars[index])) ! index++; ! if (index < n) ! list.append(new PyString(string.substring(index, n))); return list; } Index: bugtests/test029.py =================================================================== RCS file: /cvsroot/jython/bugtests/test029.py,v retrieving revision 1.1 diff -c -r1.1 test029.py *** bugtests/test029.py 14 Jul 2001 17:22:37 -0000 1.1 --- bugtests/test029.py 18 Dec 2002 21:08:19 -0000 *************** *** 1,8 **** --- 1,13 ---- """ Check split error. + Check bug [ 654863 ] string.split behaves differently. """ import support import string string.split("aa::bb::cc:", "::") + + r = 'a '.split(None,1) + if r != ['a']: + raise support.TestError(repr(r))