From: Hynek Schlawack Date: Wed, 7 Nov 2012 08:07:22 +0000 (+0100) Subject: Issue #15001: fix segfault on "del sys.module['__main__']" X-Git-Tag: v3.3.1rc1~672 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=33363f43e34defa17ad958ad6d718328f9e78db8;p=python Issue #15001: fix segfault on "del sys.module['__main__']" Patch by Victor Stinner. --- 33363f43e34defa17ad958ad6d718328f9e78db8 diff --cc Misc/NEWS index 63baa0d0f9,6901beccf5..2f2ed8967c --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -12,12 -10,12 +12,15 @@@ What's New in Python 3.3.1 Core and Builtins ----------------- + - Issue #15001: fix segfault on "del sys.module['__main__']". Patch by Victor + Stinner. + -- Issue #5057: the peepholer no longer optimizes subscription on unicode - literals (e.g. u'foo'[0]) in order to produce compatible pyc files between - narrow and wide builds. +- Issue #8271: the utf-8 decoder now outputs the correct number of U+FFFD + characters when used with the 'replace' error handler on invalid utf-8 + sequences. Patch by Serhiy Storchaka, tests by Ezio Melotti. + +- Issue #5765: Apply a hard recursion limit in the compiler instead of + blowing the stack and segfaulting. Initial patch by Andrea Griffini. - Issue #16402: When slicing a range, fix shadowing of exceptions from __index__. diff --cc Python/pythonrun.c index 7c4fb4a3c9,3639fa7e22..dd32017574 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@@ -1420,9 -1287,8 +1421,8 @@@ PyRun_SimpleFileExFlags(FILE *fp, cons /* Try to run a pyc file. First, re-open in binary */ if (closeit) fclose(fp); - if ((fp = fopen(filename, "rb")) == NULL) { + if ((pyc_fp = fopen(filename, "rb")) == NULL) { fprintf(stderr, "python: Can't reopen .pyc file\n"); - ret = -1; goto done; } /* Turn on optimization if a .pyo file is given */