This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Patch for bug #1380970
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: collinwinter
Priority: normal Keywords: patch

Created on 2006-01-25 20:52 by collinwinter, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
split_rsplit.patch collinwinter, 2006-01-25 20:52 Fix {str,unicode}.{split,rsplit}, against r42185
Messages (2)
msg49410 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2006-01-25 20:52
The split and rsplit methods for both string and
unicode types currently do not live up to their
documentation.

The docs say (quoting from docs.python.org/dev):

"""
If sep is not specified or is None, a different
splitting algorithm is applied. First, whitespace
characters (spaces, tabs, newlines, returns, and
formfeeds) are stripped from both ends.
"""

As of svn revision 42185, these methods only strip
whitespace from one end. The attached patch makes all
four methods (str.split, str.rsplit, unicode.split,
unicode.rsplit) remove whitespace from both ends of the
string.

The patch also modifies Lib/test/string_tests.py to add
checks for this to the regression suite.

The patch passes the full regression suite.

PS: if I could get a review of patch #1412451, that
would be smashing. Thanks.
msg49411 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2007-03-08 18:27
Raymond Hettinger rejected the referenced bug report, so I'm marking this as "rejected", too.
History
Date User Action Args
2022-04-11 14:56:15adminsetgithub: 42838
2006-01-25 20:52:53collinwintercreate