Closed aaaaalbert closed 7 years ago
Oh, in case you wonder why that specific commit has this problem: I'm working on adding different parties' security layers to a sandbox, and this involves iterating over the read-virtualnamespace-evaluation loop in repy.py
multiple times. The error arises because the builtins are removed the first time through the loop already.
(However, there might exist constructions where the problem shows in the vanilla sandbox too. I'm thinking of stacked VirtualNamespace
s, or encasementlib
tricks, or similar. Needs testing!)
The SafeDict
issue was documented as SeattleTestbed/repy_v2#125, and subsequently fixed in SeattleTestbed/repy_v2#139. Closing this private issue too.
8eb44d9112965e7c81d42c2bb94aebdb354d10ee exposes an interesting bug similar to SeattleTestbed/repy_v2#69 where trying to
update
aSafeDict
object results in the underlying implementation'sUserDict
attempting to callhasattr
, which (by that time) has been disabled and replaced by an error-raising function viasafe.py
.The usual simple fix consists of stashing
hasattr
inside the module: