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
504de6bd
Commit
504de6bd
authored
Oct 06, 2003
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for SF bug [ 817156 ] invalid \U escape gives 0=length unistr.
parent
dbe3d280
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
Lib/test/test_unicode.py
Lib/test/test_unicode.py
+7
-0
Objects/unicodeobject.c
Objects/unicodeobject.c
+1
-1
No files found.
Lib/test/test_unicode.py
View file @
504de6bd
...
...
@@ -33,6 +33,13 @@ class UnicodeTest(
self
.
assertEqual
(
realresult
,
result
)
self
.
assert_
(
object
is
not
realresult
)
def
test_literals
(
self
):
self
.
assertEqual
(
u'
\
xff
'
,
u'
\
u00ff
'
)
self
.
assertEqual
(
u'
\
uffff
'
,
u'
\
U0000ffff
'
)
self
.
assertRaises
(
UnicodeError
,
eval
,
'u
\
'
\
\
Ufffffffe
\
'
'
)
self
.
assertRaises
(
UnicodeError
,
eval
,
'u
\
'
\
\
Uffffffff
\
'
'
)
self
.
assertRaises
(
UnicodeError
,
eval
,
'u
\
'
\
\
U%08x
\
'
'
%
0x110000
)
def
test_repr
(
self
):
if
not
sys
.
platform
.
startswith
(
'java'
):
# Test basic sanity of repr()
...
...
Objects/unicodeobject.c
View file @
504de6bd
...
...
@@ -1750,7 +1750,7 @@ PyObject *PyUnicode_DecodeUnicodeEscape(const char *s,
chr
+=
10
+
c
-
'A'
;
}
s
+=
i
;
if
(
chr
==
0xffffffff
)
if
(
chr
==
0xffffffff
&&
PyErr_Occurred
()
)
/* _decoding_error will have already written into the
target buffer. */
break
;
...
...
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