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
9cd87aaa
Commit
9cd87aaa
authored
Oct 23, 2002
by
Marc-André Lemburg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug #626172: crash using unicode latin1 single char
Python 2.2.3 candidate.
parent
45186c4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
Lib/test/test_unicode.py
Lib/test/test_unicode.py
+6
-0
Objects/unicodeobject.c
Objects/unicodeobject.c
+1
-3
No files found.
Lib/test/test_unicode.py
View file @
9cd87aaa
...
@@ -434,6 +434,12 @@ vereq((u'ab' in 'abc'), True)
...
@@ -434,6 +434,12 @@ vereq((u'ab' in 'abc'), True)
vereq
((
u'ab'
in
(
1
,
None
,
u'ab'
)),
True
)
vereq
((
u'ab'
in
(
1
,
None
,
u'ab'
)),
True
)
vereq
((
u''
in
u'abc'
),
True
)
vereq
((
u''
in
u'abc'
),
True
)
vereq
((
''
in
u'abc'
),
True
)
vereq
((
''
in
u'abc'
),
True
)
try
:
u'
\
xe2
'
in
'g
\
xe2
teau'
except
UnicodeError
:
pass
else
:
print
'*** contains operator does not propagate UnicodeErrors'
print
'done.'
print
'done.'
# Formatting:
# Formatting:
...
...
Objects/unicodeobject.c
View file @
9cd87aaa
...
@@ -4485,10 +4485,8 @@ int PyUnicode_Contains(PyObject *container,
...
@@ -4485,10 +4485,8 @@ int PyUnicode_Contains(PyObject *container,
goto
onError
;
goto
onError
;
}
}
u
=
(
PyUnicodeObject
*
)
PyUnicode_FromObject
(
container
);
u
=
(
PyUnicodeObject
*
)
PyUnicode_FromObject
(
container
);
if
(
u
==
NULL
)
{
if
(
u
==
NULL
)
Py_DECREF
(
v
);
goto
onError
;
goto
onError
;
}
size
=
PyUnicode_GET_SIZE
(
v
);
size
=
PyUnicode_GET_SIZE
(
v
);
rhs
=
PyUnicode_AS_UNICODE
(
v
);
rhs
=
PyUnicode_AS_UNICODE
(
v
);
...
...
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