Skip to content

Commit 0895793

Browse files
committed
Add some examples in what's new entry.
And replace PendingDeprecationWarning with DeprecationWarning.
1 parent 56d7806 commit 0895793

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

Doc/whatsnew/3.8.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -701,9 +701,10 @@ Changes in the Python API
701701
Changes in the C API
702702
--------------------
703703

704-
* Use of ``#`` variants of formats without ``PY_SSIZE_T_CLEAN`` defined
705-
raises ``PendingDeprecationWarning`` now. Read :ref:`arg-parsing` for
706-
detail.
704+
* Use of ``#`` variants of formats in parsing or building value (e.g.
705+
:c:func:`PyArg_ParseTuple`, :c:func:`Py_BuildValue`, :c:func:`PyObject_CallFunction`,
706+
etc.) without ``PY_SSIZE_T_CLEAN`` defined raises ``DeprecationWarning`` now.
707+
It will be removed in 3.10 or 4.0. Read :ref:`arg-parsing` for detail.
707708
(Contributed by Inada Naoki in :issue:`36381`.)
708709

709710

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Raise PendingDeprecationWarning when '#' formats are used for building or
2-
parsing values without PY_SSIZE_T_CLEAN.
1+
Raise ``DeprecationWarning`` when '#' formats are used for building or
2+
parsing values without ``PY_SSIZE_T_CLEAN``.

Python/getargs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
682682
#define FETCH_SIZE int *q=NULL;Py_ssize_t *q2=NULL;\
683683
if (flags & FLAG_SIZE_T) q2=va_arg(*p_va, Py_ssize_t*); \
684684
else { \
685-
if (PyErr_WarnEx(PyExc_PendingDeprecationWarning, \
685+
if (PyErr_WarnEx(PyExc_DeprecationWarning, \
686686
"PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) { \
687687
return NULL; \
688688
} \
@@ -2598,7 +2598,7 @@ skipitem(const char **p_format, va_list *p_va, int flags)
25982598
if (flags & FLAG_SIZE_T)
25992599
(void) va_arg(*p_va, Py_ssize_t *);
26002600
else {
2601-
if (PyErr_WarnEx(PyExc_PendingDeprecationWarning,
2601+
if (PyErr_WarnEx(PyExc_DeprecationWarning,
26022602
"PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) {
26032603
return NULL;
26042604
}

Python/modsupport.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags)
343343
if (flags & FLAG_SIZE_T)
344344
n = va_arg(*p_va, Py_ssize_t);
345345
else {
346-
if (PyErr_WarnEx(PyExc_PendingDeprecationWarning,
346+
if (PyErr_WarnEx(PyExc_DeprecationWarning,
347347
"PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) {
348348
return NULL;
349349
}
@@ -396,7 +396,7 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags)
396396
if (flags & FLAG_SIZE_T)
397397
n = va_arg(*p_va, Py_ssize_t);
398398
else {
399-
if (PyErr_WarnEx(PyExc_PendingDeprecationWarning,
399+
if (PyErr_WarnEx(PyExc_DeprecationWarning,
400400
"PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) {
401401
return NULL;
402402
}
@@ -434,7 +434,7 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags)
434434
if (flags & FLAG_SIZE_T)
435435
n = va_arg(*p_va, Py_ssize_t);
436436
else {
437-
if (PyErr_WarnEx(PyExc_PendingDeprecationWarning,
437+
if (PyErr_WarnEx(PyExc_DeprecationWarning,
438438
"PY_SSIZE_T_CLEAN will be required for '#' formats", 1)) {
439439
return NULL;
440440
}

0 commit comments

Comments
 (0)