]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Fix regression in 2.9 involving unsafe Context.get_all() usage
authorZac Medico <zmedico@gmail.com>
Tue, 8 Aug 2017 22:00:20 +0000 (15:00 -0700)
committerArmin Ronacher <armin.ronacher@active-4.com>
Wed, 9 Aug 2017 07:05:54 +0000 (09:05 +0200)
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")
jinja2/debug.py

index 07c21f1a8bd26a99f234e1221e4603c1035439f2..b61139f0cde17f4914b66bdd541ff149f492fe1d 100644 (file)
@@ -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 = {}