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
d004fc81
Commit
d004fc81
authored
May 27, 2006
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch 1494554: Update numeric properties to Unicode 4.1.
parent
d1b6cd7b
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
336 additions
and
11 deletions
+336
-11
Doc/api/concrete.tex
Doc/api/concrete.tex
+1
-1
Lib/test/test_unicodedata.py
Lib/test/test_unicodedata.py
+2
-2
Misc/NEWS
Misc/NEWS
+3
-0
Modules/unicodedata.c
Modules/unicodedata.c
+2
-2
Objects/unicodectype.c
Objects/unicodectype.c
+327
-6
Objects/unicodeobject.c
Objects/unicodeobject.c
+1
-0
No files found.
Doc/api/concrete.tex
View file @
d004fc81
...
...
@@ -965,7 +965,7 @@ These APIs can be used for fast direct character conversions:
\end{cfuncdesc}
\begin{cfuncdesc}
{
double
}{
Py
_
UNICODE
_
TONUMERIC
}{
Py
_
UNICODE ch
}
Return the character
\var
{
ch
}
converted to a
(positive)
double.
Return the character
\var
{
ch
}
converted to a double.
Return
\code
{
-1.0
}
if this is not possible. This macro does not raise
exceptions.
\end{cfuncdesc}
...
...
Lib/test/test_unicodedata.py
View file @
d004fc81
...
...
@@ -16,7 +16,7 @@ encoding = 'utf-8'
class
UnicodeMethodsTest
(
unittest
.
TestCase
):
# update this, if the database changes
expectedchecksum
=
'
a6555cd209d960dcfa17bfdce0c96d91cfa9a9b
a'
expectedchecksum
=
'
c198ed264497f108434b3f576d4107237221cc8
a'
def
test_method_checksum
(
self
):
h
=
hashlib
.
sha1
()
...
...
@@ -75,7 +75,7 @@ class UnicodeDatabaseTest(unittest.TestCase):
class
UnicodeFunctionsTest
(
UnicodeDatabaseTest
):
# update this, if the database changes
expectedchecksum
=
'
b45b79f3203ee1a896d9b5655484adaff5d4964b
'
expectedchecksum
=
'
4e389f97e9f88b8b7ab743121fd643089116f9f2
'
def
test_function_checksum
(
self
):
data
=
[]
...
...
Misc/NEWS
View file @
d004fc81
...
...
@@ -12,6 +12,9 @@ What's New in Python 2.5 alpha 3?
Core and builtins
-----------------
- Patch #1494554: Update unicodedata.numeric and unicode.isnumeric to
Unicode 4.1.
- Patch #921466: sys.path_importer_cache is now used to cache valid and
invalid file paths for the built-in import machinery which leads to
fewer open calls on startup.
...
...
Modules/unicodedata.c
View file @
d004fc81
...
...
@@ -209,7 +209,7 @@ unicodedata_numeric(PyObject *self, PyObject *args)
if
(
old
->
category_changed
==
0
)
{
/* unassigned */
have_old
=
1
;
rc
=
-
1
;
rc
=
-
1
.
0
;
}
else
if
(
old
->
decimal_changed
!=
0xFF
)
{
have_old
=
1
;
...
...
@@ -219,7 +219,7 @@ unicodedata_numeric(PyObject *self, PyObject *args)
if
(
!
have_old
)
rc
=
Py_UNICODE_TONUMERIC
(
*
PyUnicode_AS_UNICODE
(
v
));
if
(
rc
<
0
)
{
if
(
rc
==
-
1
.
0
)
{
if
(
defobj
==
NULL
)
{
PyErr_SetString
(
PyExc_ValueError
,
"not a numeric character"
);
return
NULL
;
...
...
Objects/unicodectype.c
View file @
d004fc81
This diff is collapsed.
Click to expand it.
Objects/unicodeobject.c
View file @
d004fc81
...
...
@@ -2376,6 +2376,7 @@ PyObject *_PyUnicode_DecodeUnicodeInternal(const char *s,
end
=
s
+
size
;
while
(
s
<
end
)
{
*
p
=
*
(
Py_UNICODE
*
)
s
;
memcpy
(
p
,
s
,
sizeof
(
Py_UNICODE
));
/* We have to sanity check the raw data, otherwise doom looms for
some malformed UCS-4 data. */
...
...
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