Ah, I just discovered PIL 25.2 (Hooks) and 25.4 (Sandboxing), so perhaps debug.sethook() will be a good way to do this. Though still interested in other solutions, if people have them. -John