summaryrefslogtreecommitdiff
path: root/Modules/_codecsmodule.c
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2009-05-06 14:41:26 +0000
committerWalter Dörwald <walter@livinglogic.de>2009-05-06 14:41:26 +0000
commit8dc33d56f55597096fa49afc3d36bed37147eb01 (patch)
treee630db45fc512ded49946dc180cffcd22b02e03b /Modules/_codecsmodule.c
parent6ca2e0ac5bc26cdf537ad256fae0c4b6942d1213 (diff)
downloadcpython-git-8dc33d56f55597096fa49afc3d36bed37147eb01.tar.gz
Merged revisions 72404-72406 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r72404 | walter.doerwald | 2009-05-06 16:28:24 +0200 (Mi, 06 Mai 2009) | 3 lines Issue 3739: The unicode-internal encoder now reports the number of *characters* consumed like any other encoder (instead of the number of bytes). ........ r72406 | walter.doerwald | 2009-05-06 16:32:35 +0200 (Mi, 06 Mai 2009) | 2 lines Add NEWS entry about issue #3739. ........
Diffstat (limited to 'Modules/_codecsmodule.c')
-rw-r--r--Modules/_codecsmodule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/_codecsmodule.c b/Modules/_codecsmodule.c
index cbcf84dd07..55b593b37d 100644
--- a/Modules/_codecsmodule.c
+++ b/Modules/_codecsmodule.c
@@ -669,7 +669,8 @@ unicode_internal_encode(PyObject *self,
if (PyUnicode_Check(obj)) {
data = PyUnicode_AS_DATA(obj);
size = PyUnicode_GET_DATA_SIZE(obj);
- return codec_tuple(PyBytes_FromStringAndSize(data, size), size);
+ return codec_tuple(PyBytes_FromStringAndSize(data, size),
+ PyUnicode_GET_SIZE(obj));
}
else {
if (PyObject_AsReadBuffer(obj, (const void **)&data, &size))