From f78186adefa8d4329342f9012be98306ffb5efc6 Mon Sep 17 00:00:00 2001 From: Oren Milman Date: Wed, 13 Sep 2017 13:06:26 +0300 Subject: [PATCH 1/4] init commit --- .../Core and Builtins/2017-09-13-13-03-52.bpo-31418.rS-FlC.rst | 2 ++ Python/errors.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2017-09-13-13-03-52.bpo-31418.rS-FlC.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2017-09-13-13-03-52.bpo-31418.rS-FlC.rst b/Misc/NEWS.d/next/Core and Builtins/2017-09-13-13-03-52.bpo-31418.rS-FlC.rst new file mode 100644 index 00000000000000..b009d3d893fe04 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2017-09-13-13-03-52.bpo-31418.rS-FlC.rst @@ -0,0 +1,2 @@ +Fix an assertion failure in case of an exception with a bad __module__ +attribute. Patch by Oren Milman. diff --git a/Python/errors.c b/Python/errors.c index 3cb6d5306f81d9..5709fddb584115 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -961,7 +961,7 @@ PyErr_WriteUnraisable(PyObject *obj) } moduleName = _PyObject_GetAttrId(t, &PyId___module__); - if (moduleName == NULL) { + if (moduleName == NULL || !PyUnicode_Check(moduleName)) { PyErr_Clear(); if (PyFile_WriteString("", f) < 0) goto done; From bf19d820b98b8c69e60eff02c8a227762fa93429 Mon Sep 17 00:00:00 2001 From: Oren Milman Date: Wed, 13 Sep 2017 13:24:49 +0300 Subject: [PATCH 2/4] fix NEWS.d item --- .../Core and Builtins/2017-09-13-13-03-52.bpo-31418.rS-FlC.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Core and Builtins/2017-09-13-13-03-52.bpo-31418.rS-FlC.rst b/Misc/NEWS.d/next/Core and Builtins/2017-09-13-13-03-52.bpo-31418.rS-FlC.rst index b009d3d893fe04..3c7d481895a68f 100644 --- a/Misc/NEWS.d/next/Core and Builtins/2017-09-13-13-03-52.bpo-31418.rS-FlC.rst +++ b/Misc/NEWS.d/next/Core and Builtins/2017-09-13-13-03-52.bpo-31418.rS-FlC.rst @@ -1,2 +1,2 @@ -Fix an assertion failure in case of an exception with a bad __module__ +Fix an assertion failure in case of an exception with a bad ``__module__`` attribute. Patch by Oren Milman. From ea8687796def90f03eb8c7b10cfe1df1bbb93afc Mon Sep 17 00:00:00 2001 From: Oren Milman Date: Wed, 13 Sep 2017 14:18:13 +0300 Subject: [PATCH 3/4] fix NEWS.d item --- .../2017-09-13-13-03-52.bpo-31418.rS-FlC.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Misc/NEWS.d/next/Core and Builtins/2017-09-13-13-03-52.bpo-31418.rS-FlC.rst b/Misc/NEWS.d/next/Core and Builtins/2017-09-13-13-03-52.bpo-31418.rS-FlC.rst index 3c7d481895a68f..9c9f4163aaea02 100644 --- a/Misc/NEWS.d/next/Core and Builtins/2017-09-13-13-03-52.bpo-31418.rS-FlC.rst +++ b/Misc/NEWS.d/next/Core and Builtins/2017-09-13-13-03-52.bpo-31418.rS-FlC.rst @@ -1,2 +1,2 @@ -Fix an assertion failure in case of an exception with a bad ``__module__`` -attribute. Patch by Oren Milman. +Fix an assertion failure in `c.PyErr_WriteUnraisable()` in case of an +exception with a bad ``__module__`` attribute. Patch by Oren Milman. From c8d815537dbe81b883b22db95753e2158e494455 Mon Sep 17 00:00:00 2001 From: Oren Milman Date: Wed, 13 Sep 2017 23:07:43 +0300 Subject: [PATCH 4/4] another fix of the NEWS.d item --- .../Core and Builtins/2017-09-13-13-03-52.bpo-31418.rS-FlC.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Core and Builtins/2017-09-13-13-03-52.bpo-31418.rS-FlC.rst b/Misc/NEWS.d/next/Core and Builtins/2017-09-13-13-03-52.bpo-31418.rS-FlC.rst index 9c9f4163aaea02..6d6cbd81142077 100644 --- a/Misc/NEWS.d/next/Core and Builtins/2017-09-13-13-03-52.bpo-31418.rS-FlC.rst +++ b/Misc/NEWS.d/next/Core and Builtins/2017-09-13-13-03-52.bpo-31418.rS-FlC.rst @@ -1,2 +1,2 @@ -Fix an assertion failure in `c.PyErr_WriteUnraisable()` in case of an +Fix an assertion failure in `PyErr_WriteUnraisable()` in case of an exception with a bad ``__module__`` attribute. Patch by Oren Milman.