| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Co-authored-by: Luca Citi Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
|
@berkerpeksag, a couple of comments accompanying the change:
|
Sorry, something went wrong.
Thanks for creating the PR. Sorry for not doing it myself, I almost forgot about the whole thing. It's good that a fix is eventually making its way into the code. |
Sorry, something went wrong.
Thanks for reporting, providing a reproducer, and proposing a fix! :) I've credited you in the NEWS entry and in the commit message. |
Sorry, something went wrong.
|
You can try _PyErr_ChainExceptions() to chain exceptions. Example: static PyObject *
_io_FileIO_close_impl(fileio *self)
/*[clinic end generated code: output=7737a319ef3bad0b input=f35231760d54a522]*/
{
PyObject *res;
PyObject *exc, *val, *tb;
int rc;
_Py_IDENTIFIER(close);
res = _PyObject_CallMethodIdOneArg((PyObject*)&PyRawIOBase_Type,
&PyId_close, (PyObject *)self);
if (!self->closefd) {
self->fd = -1;
return res;
}
if (res == NULL)
PyErr_Fetch(&exc, &val, &tb);
if (self->finalizing) {
PyObject *r = fileio_dealloc_warn(self, (PyObject *) self);
if (r)
Py_DECREF(r);
else
PyErr_Clear();
}
rc = internal_close(self);
if (res == NULL)
_PyErr_ChainExceptions(exc, val, tb);
if (rc < 0)
Py_CLEAR(res);
return res;
}
|
Sorry, something went wrong.
Thanks! I'll have a look at this after #26462 is resolved :) |
Sorry, something went wrong.
|
@erlend-aasland Does this need backports? If not, please close the issue :) |
Sorry, something went wrong.
|
It's a bugfix, so I'd backport to 3.10 and 3.9. (I suspect the backports must be done manually) |
Sorry, something went wrong.
|
Thank you so much for reviewing, Pablo and Victor! |
Sorry, something went wrong.
|
Thanks @erlend-aasland for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9. |
Sorry, something went wrong.
|
Thanks @erlend-aasland for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10. |
Sorry, something went wrong.
|
Sorry, @erlend-aasland and @pablogsal, I could not cleanly backport this to 3.9 due to a conflict. |
Sorry, something went wrong.
|
Sorry @erlend-aasland and @pablogsal, I had trouble checking out the 3.10 backport branch. |
Sorry, something went wrong.
|
GH-27943 is a backport of this pull request to the 3.10 branch. |
Sorry, something went wrong.
…ils to commit (pythonGH-26202) Co-authored-by: Luca Citi Co-authored-by: Berker Peksag <berker.peksag@gmail.com>. (cherry picked from commit 7ecd342) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
|
GH-27944 is a backport of this pull request to the 3.9 branch. |
Sorry, something went wrong.
…ls to commit (pythonGH-26202) Co-authored-by: Luca Citi Co-authored-by: Berker Peksag <berker.peksag@gmail.com>. (cherry picked from commit 7ecd342) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
| Back | FazBrowse Home | New Git URL |
https://bugs.python.org/issue27334