https://github.com/python/cpython/commit/d6238a76c655e0feb13478505220dc9049f1682f commit: d6238a76c655e0feb13478505220dc9049f1682f branch: master author: Serhiy Storchaka <storchaka at gmail.com> committer: GitHub <noreply at github.com> date: 2017年09月24日T02:49:58+03:00 summary: bpo-25359: Add missed "goto error" after setting an exception. (#3712) files: M Modules/_io/textio.c diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index 9b7334d3b54..5239e8518e6 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -941,6 +941,7 @@ _io_TextIOWrapper___init___impl(textio *self, PyObject *buffer, else { PyErr_SetString(PyExc_OSError, "could not determine default encoding"); + goto error; } /* Check we have been asked for a real text encoding */