From: Zac Medico Date: Tue, 8 Aug 2017 22:00:20 +0000 (-0700) Subject: Fix regression in 2.9 involving unsafe Context.get_all() usage X-Git-Tag: 2.9.x~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60a7e775d487c8de9f1b0f23c91ca9845c161fc2;p=thirdparty%2Fjinja.git Fix regression in 2.9 involving unsafe Context.get_all() usage Since commit d67f0fd4cc2a4af08f51f4466150d49da7798729, callers of Context.get_all() need to make a copy it they're going to modify the result. Fixes: d67f0fd4cc2a ("Generalize scoping. This fixes #603") --- diff --git a/jinja2/debug.py b/jinja2/debug.py index 07c21f1a..b61139f0 100644 --- a/jinja2/debug.py +++ b/jinja2/debug.py @@ -198,7 +198,7 @@ def translate_exception(exc_info, initial_skip=0): def get_jinja_locals(real_locals): ctx = real_locals.get('context') if ctx: - locals = ctx.get_all() + locals = ctx.get_all().copy() else: locals = {}