[Guido van Rossum]
This seems a bug. In revision 36714 by Raymond Hettinger, the restriction that locals be a dict was relaxed to allow any mapping.
Mea culpa, I thought I reviewed this patch at the time. Fixed in r52862-52863.
Armin, thanks for the check-ins. Daniel, thanks for finding one of the cases I missed. Will load a unittest for this one when I get a chance.