Message370603
I'm currently investigating a SystemError one of our workers returned:
<method 'dump' of '_pickle.Pickler' objects> returned NULL without setting an error
While doing so I came across the _Pickler_CommitFrame() function:
static int
_Pickler_CommitFrame(PicklerObject *self)
{
size_t frame_len;
char *qdata;
if (!self->framing || self->frame_start == -1)
return 0;
frame_len = self->output_len - self->frame_start - FRAME_HEADER_SIZE;
qdata = PyBytes_AS_STRING(self->output_buffer) + self->frame_start;
if (frame_len >= FRAME_SIZE_MIN) {
qdata[0] = FRAME;
_write_size64(qdata + 1, frame_len);
}
else {
memmove(qdata, qdata + FRAME_HEADER_SIZE, frame_len);
self->output_len -= FRAME_HEADER_SIZE;
}
self->frame_start = -1;
return 0;
}
Is there a reason for this function to return an int if it is always 0? I checked all call sites (_Pickler_GetString(), _Pickler_OpcodeBoundary(), _Pickler_write_bytes() and dump()) and they all check the return code but it seems useless. |
|
Date |
User |
Action |
Args |
2020-06-02 11:05:03 | remi.lapeyre | set | recipients:
+ remi.lapeyre |
2020-06-02 11:05:03 | remi.lapeyre | set | messageid: <1591095903.49.0.200421685869.issue40842@roundup.psfhosted.org> |
2020-06-02 11:05:03 | remi.lapeyre | link | issue40842 messages |
2020-06-02 11:05:03 | remi.lapeyre | create | |
|