Bug report
This call is problematic:
|
#define SET(i,val) PyStructSequence_SET_ITEM(v, i, PyLong_FromLong((long) val)) |
It can return NULL in theory.
These calls also can return NULL:
|
PyStructSequence_SET_ITEM(v, 9, |
|
PyUnicode_DecodeLocale(p->tm_zone, "surrogateescape")); |
|
PyStructSequence_SET_ITEM(v, 9, |
|
PyUnicode_DecodeLocale(zone, "surrogateescape")); |
This error guard in the end will only show the last error:
|
if (PyErr_Occurred()) { |
|
Py_XDECREF(v); |
|
return NULL; |
|
} |
Not the first one. Also: why
XDECREF when
v cannot be
NULL at this point?
Refs #116714
I will send a PR adding our regular macro for the job.
Linked PRs
Bug report
This call is problematic:
cpython/Modules/timemodule.c
Line 465 in f526314
It can return
NULLin theory.These calls also can return
NULL:cpython/Modules/timemodule.c
Lines 477 to 478 in f526314
cpython/Modules/timemodule.c
Lines 481 to 482 in f526314
This error guard in the end will only show the last error:
cpython/Modules/timemodule.c
Lines 486 to 489 in f526314
XDECREFwhenvcannot beNULLat this point?Refs #116714
I will send a PR adding our regular macro for the job.
Linked PRs
tmtotupleintimemodule#118999tmtotupleintimemodule(GH-118999) #119018tmtotupleintimemodule(GH-118999) #119019