summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-06-08 21:46:32 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-06-08 21:46:32 (GMT)
commit55b002f096cf85b8646df1c0ba87445fd326e239 (patch)
treecd20492fe432933d2e8e56e3f24907eb475b721e /Python
parent93362d4e6bb5fbcc1b60ec88676c5d12583350fd (diff)
downloadcpython-55b002f096cf85b8646df1c0ba87445fd326e239.zip
cpython-55b002f096cf85b8646df1c0ba87445fd326e239.tar.gz
cpython-55b002f096cf85b8646df1c0ba87445fd326e239.tar.bz2
Merged revisions 81849 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r81849 | victor.stinner | 2010-06-08 23:45:51 +0200 (mar., 08 juin 2010) | 7 lines PyArg_Parse*("Z#") raises an error for unknown type instead of ignoring the error and leave the pointer to the string and the size unchanged (not initialized). Fix also the type in the error message of "Z", "Z#" and "Y" formats. ........
Diffstat (limited to 'Python')
-rw-r--r--Python/getargs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Python/getargs.c b/Python/getargs.c
index dec8602..272ce19 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -1048,6 +1048,8 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
*p = PyUnicode_AS_UNICODE(arg);
STORE_SIZE(PyUnicode_GET_SIZE(arg));
}
+ else
+ return converterr("str or None", arg, msgbuf, bufsize);
format++;
} else {
Py_UNICODE **p = va_arg(*p_va, Py_UNICODE **);
@@ -1057,8 +1059,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
else if (PyUnicode_Check(arg))
*p = PyUnicode_AS_UNICODE(arg);
else
- return converterr("string or None",
- arg, msgbuf, bufsize);
+ return converterr("str or None", arg, msgbuf, bufsize);
}
break;
}
@@ -1253,7 +1254,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
if (PyByteArray_Check(arg))
*p = arg;
else
- return converterr("buffer", arg, msgbuf, bufsize);
+ return converterr("bytearray", arg, msgbuf, bufsize);
break;
}