diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-09-11 00:54:47 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-09-11 00:54:47 (GMT) |
commit | 1205f2774e00d38d3229a3a2742c2fcbc767bdde (patch) | |
tree | 8f5756aa974326bf503dfaad7512aff103bde9bb /Include | |
parent | cd419abe42b42c626d91d5f839d53bdbde9852e0 (diff) | |
download | cpython-1205f2774e00d38d3229a3a2742c2fcbc767bdde.zip cpython-1205f2774e00d38d3229a3a2742c2fcbc767bdde.tar.gz cpython-1205f2774e00d38d3229a3a2742c2fcbc767bdde.tar.bz2 |
Issue #9738: PyUnicode_FromFormat() and PyErr_Format() raise an error on
a non-ASCII byte in the format string.
Document also the encoding.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/pyerrors.h | 6 | ||||
-rw-r--r-- | Include/unicodeobject.h | 10 |
2 files changed, 13 insertions, 3 deletions
diff --git a/Include/pyerrors.h b/Include/pyerrors.h index 1eee16d..243bc01 100644 --- a/Include/pyerrors.h +++ b/Include/pyerrors.h @@ -183,7 +183,11 @@ PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename( PyObject *, const Py_UNICODE *); #endif /* MS_WINDOWS */ -PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...); +PyAPI_FUNC(PyObject *) PyErr_Format( + PyObject *exception, + const char *format, /* ASCII-encoded string */ + ... + ); #ifdef MS_WINDOWS PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilenameObject( diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index 0de0d66..820850a 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -550,8 +550,14 @@ PyAPI_FUNC(PyObject*) PyUnicode_FromObject( register PyObject *obj /* Object */ ); -PyAPI_FUNC(PyObject *) PyUnicode_FromFormatV(const char*, va_list); -PyAPI_FUNC(PyObject *) PyUnicode_FromFormat(const char*, ...); +PyAPI_FUNC(PyObject *) PyUnicode_FromFormatV( + const char *format, /* ASCII-encoded string */ + va_list vargs + ); +PyAPI_FUNC(PyObject *) PyUnicode_FromFormat( + const char *format, /* ASCII-encoded string */ + ... + ); /* Format the object based on the format_spec, as defined in PEP 3101 (Advanced String Formatting). */ |