cpython: 03b2259c6cd3 (original) (raw)

Mercurial > cpython

changeset 95751:03b2259c6cd3

merge 3.4 (#24022) [#24022]

Benjamin Peterson benjamin@python.org
date Tue, 21 Apr 2015 12:07:06 -0400
parents 475c6a4dfab3(current diff)414e08c478f4(diff)
children 03330e5edb37
files Lib/test/test_compile.py Misc/NEWS Parser/tokenizer.c
diffstat 3 files changed, 18 insertions(+), 5 deletions(-)[+] [-] Lib/test/test_compile.py 14 Misc/NEWS 2 Parser/tokenizer.c 7

line wrap: on

line diff

--- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -1,9 +1,11 @@ import math +import os import unittest import sys import _ast +import tempfile import types -from test import support +from test import support, script_helper class TestSpecifics(unittest.TestCase): @@ -492,6 +494,16 @@ if 1: self.assertInvalidSingle('f()\nxy # blah\nblah()') self.assertInvalidSingle('x = 5 # comment\nx = 6\n')

+ @support.cpython_only def test_compiler_recursion_limit(self): # Expected limit is sys.getrecursionlimit() * the scaling factor

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,8 @@ Release date: 2015-04-24 Core and Builtins ----------------- +- Issue #24022: Fix tokenizer crash when processing undecodable source code. + Library -------

--- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -1307,6 +1307,8 @@ verify_identifier(struct tok_state *tok) { PyObject *s; int result;

@@ -1475,11 +1477,8 @@ tok_get(struct tok_state *tok, char **p_ c = tok_nextc(tok); } tok_backup(tok, c);