[Python-bugs-list] [Bug #122162] split is broken for unicode strings

noreply@sourceforge.net noreply@sourceforge.net
Fri, 10 Nov 2000 15:03:18 -0800


Bug #122162, was updated on 2000-Nov-10 14:22
Here is a current snapshot of the bug.

Project: Python
Category: Core
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Summary: split is broken for unicode strings

Details: Calling the split method on a unicode string or with a unicode string is broken if the substring being split on is at the end of the source string. 

Example:

Python 2.0 (#8, Oct 16 2000, 17:27:58) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
IDLE 0.6 -- press F1 for help
>>> a = 'border case test'
>>> a.split('test')
['border case ', '']
>>> a.split(u'test')
[u'border case test']
>>> u = u'border case test'
>>> u.split('test')
[u'border case test']
>>> u.split(u'test')
[u'border case test']

Follow-Ups:

Date: 2000-Nov-10 15:03
By: gvanrossum

Comment:
Indeed.  This only seems to be a problem if

1) the split arg is longer than 1 char
2) the split arg doesn't occur at all

Probably a boundary case in the Unicode split. Assigned to Marc-Andre.
-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=122162&group_id=5470