Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7fc4cf57
Commit
7fc4cf57
authored
Dec 23, 2003
by
Hye-Shik Chang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix unicode.rsplit()'s bug that ignores separater on the end of string when
using specialized splitter for 1 char sep.
parent
0490fe96
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
Lib/test/string_tests.py
Lib/test/string_tests.py
+2
-0
Objects/unicodeobject.c
Objects/unicodeobject.c
+1
-1
No files found.
Lib/test/string_tests.py
View file @
7fc4cf57
...
@@ -208,6 +208,8 @@ class CommonTest(unittest.TestCase):
...
@@ -208,6 +208,8 @@ class CommonTest(unittest.TestCase):
self
.
checkequal
([
'a
\
x00
b'
,
'c'
],
'a
\
x00
b
\
x00
c'
,
'rsplit'
,
'
\
x00
'
,
1
)
self
.
checkequal
([
'a
\
x00
b'
,
'c'
],
'a
\
x00
b
\
x00
c'
,
'rsplit'
,
'
\
x00
'
,
1
)
self
.
checkequal
([
''
,
''
],
'abcd'
,
'rsplit'
,
'abcd'
)
self
.
checkequal
([
''
,
''
],
'abcd'
,
'rsplit'
,
'abcd'
)
self
.
checkequal
([
u'a b'
,
u'c'
,
u'd'
],
'a b c d'
,
'rsplit'
,
u' '
,
2
)
self
.
checkequal
([
u'a b'
,
u'c'
,
u'd'
],
'a b c d'
,
'rsplit'
,
u' '
,
2
)
self
.
checkequal
([
''
,
' endcase'
],
'| endcase'
,
'rsplit'
,
'|'
)
self
.
checkequal
([
''
,
' endcase'
],
'test endcase'
,
'rsplit'
,
'test'
)
def
test_strip
(
self
):
def
test_strip
(
self
):
self
.
checkequal
(
'hello'
,
' hello '
,
'strip'
)
self
.
checkequal
(
'hello'
,
' hello '
,
'strip'
)
...
...
Objects/unicodeobject.c
View file @
7fc4cf57
...
@@ -4294,7 +4294,7 @@ PyObject *rsplit_char(PyUnicodeObject *self,
...
@@ -4294,7 +4294,7 @@ PyObject *rsplit_char(PyUnicodeObject *self,
}
else
}
else
i
--
;
i
--
;
}
}
if
(
j
>=
0
)
{
if
(
j
>=
-
1
)
{
SPLIT_INSERT
(
self
->
str
,
0
,
j
+
1
);
SPLIT_INSERT
(
self
->
str
,
0
,
j
+
1
);
}
}
return
list
;
return
list
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment