You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bpo-1123: split(None, maxsplit) does not strip whitespace correctly
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2007-10-07.20:06:03.034>created_at=<Date2007-10-05.13:20:23.067>labels= ['type-bug']
title='str.split bug when using sep = None and maxsplit'updated_at=<Date2007-10-07.20:06:03.033>user='https://bugs.python.org/QuantumTim'
From the docs for str.split:
"If sep is not specified or is None... First, whitespace characters are
stripped from both ends. Then, words are separated by arbitrary length
strings of whitespace characters."
However, ' a b c '.split(None, 1) returns ['a', 'b c '] indicating that
the "stripped from both ends" isn't taking place, but that it's
removing whitespace as it goes and never gets to the end as it stops
parsing when it hits the first split.
Note this is easily worked around by calling str.strip().split(None,
1), but it would be good not to have to.
I've tested this on windows version 2.5, and 2.4.4 for Debian
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: