GeezerVison is showing github.com — [3.14] gh-146615: Fix format specifiers in extension modules (GH-146617) · serhiy-storchaka/cpython@de63d17
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: Modules/_asynciomodule.c +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2255,7 +2255,7 @@ enter_task(PyObject *loop, PyObject *task) | 2255 | 2255 | PyExc_RuntimeError, | 2256 | 2256 | "Cannot enter into task %R while another " \ | 2257 | 2257 | "task %R is being executed.", | 2258 | | - task, ts->asyncio_running_task, NULL); | | 2258 | + task, ts->asyncio_running_task); | 2259 | 2259 | return -1; | 2260 | 2260 | } | 2261 | 2261 |
| @@ -2278,7 +2278,7 @@ leave_task(PyObject *loop, PyObject *task) | 2278 | 2278 | PyExc_RuntimeError, | 2279 | 2279 | "Invalid attempt to leave task %R while " \ | 2280 | 2280 | "task %R is entered.", | 2281 | | - task, ts->asyncio_running_task ? ts->asyncio_running_task : Py_None, NULL); | | 2281 | + task, ts->asyncio_running_task ? ts->asyncio_running_task : Py_None); | 2282 | 2282 | return -1; | 2283 | 2283 | } | 2284 | 2284 | Py_CLEAR(ts->asyncio_running_task); | @@ -2343,7 +2343,7 @@ _asyncio_Task___init___impl(TaskObj *self, PyObject *coro, PyObject *loop, | 2343 | 2343 | self->task_log_destroy_pending = 0; | 2344 | 2344 | PyErr_Format(PyExc_TypeError, | 2345 | 2345 | "a coroutine was expected, got %R", | 2346 | | - coro, NULL); | | 2346 | + coro); | 2347 | 2347 | return -1; | 2348 | 2348 | } | 2349 | 2349 |
| |
Collapse file Copy file name to clipboardExpand all lines: Modules/_ssl.c +5-9Lines changed: 5 additions & 9 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -577,7 +577,7 @@ fill_and_set_sslerror(_sslmodulestate *state, | 577 | 577 | } | 578 | 578 | else { | 579 | 579 | if (PyUnicodeWriter_Format( | 580 | | - writer, "unknown error (0x%x)", errcode) < 0) { | | 580 | + writer, "unknown error (0x%lx)", errcode) < 0) { | 581 | 581 | goto fail; | 582 | 582 | } | 583 | 583 | } | @@ -3597,15 +3597,11 @@ _ssl__SSLContext_verify_flags_set_impl(PySSLContext *self, PyObject *value) | 3597 | 3597 | static int | 3598 | 3598 | set_min_max_proto_version(PySSLContext *self, PyObject *arg, int what) | 3599 | 3599 | { | 3600 | | - long v; | | 3600 | + int v; | 3601 | 3601 | int result; | 3602 | 3602 |
| 3603 | | - if (!PyArg_Parse(arg, "l", &v)) | | 3603 | + if (!PyArg_Parse(arg, "i", &v)) | 3604 | 3604 | return -1; | 3605 | | - if (v > INT_MAX) { | 3606 | | - PyErr_SetString(PyExc_OverflowError, "Option is too long"); | 3607 | | - return -1; | 3608 | | - } | 3609 | 3605 |
| 3610 | 3606 | switch(self->protocol) { | 3611 | 3607 | case PY_SSL_VERSION_TLS_CLIENT: _Py_FALLTHROUGH; | @@ -3640,7 +3636,7 @@ set_min_max_proto_version(PySSLContext *self, PyObject *arg, int what) | 3640 | 3636 | break; | 3641 | 3637 | default: | 3642 | 3638 | PyErr_Format(PyExc_ValueError, | 3643 | | - "Unsupported TLS/SSL version 0x%x", v); | | 3639 | + "Unsupported TLS/SSL version 0x%x", (unsigned)v); | 3644 | 3640 | return -1; | 3645 | 3641 | } | 3646 | 3642 |
| @@ -3674,7 +3670,7 @@ set_min_max_proto_version(PySSLContext *self, PyObject *arg, int what) | 3674 | 3670 | } | 3675 | 3671 | if (result == 0) { | 3676 | 3672 | PyErr_Format(PyExc_ValueError, | 3677 | | - "Unsupported protocol version 0x%x", v); | | 3673 | + "Unsupported protocol version 0x%x", (unsigned)v); | 3678 | 3674 | return -1; | 3679 | 3675 | } | 3680 | 3676 | return 0; | |
Collapse file Copy file name to clipboardExpand all lines: Modules/_zoneinfo.c +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -988,7 +988,7 @@ load_data(zoneinfo_state *state, PyZoneInfo_ZoneInfo *self, PyObject *file_obj) | 988 | 988 | } | 989 | 989 |
| 990 | 990 | if (!PyTuple_CheckExact(data_tuple)) { | 991 | | - PyErr_Format(PyExc_TypeError, "Invalid data result type: %r", | | 991 | + PyErr_Format(PyExc_TypeError, "Invalid data result type: %R", | 992 | 992 | data_tuple); | 993 | 993 | goto error; | 994 | 994 | } | |
|