My sys.excepthook dies painfully

Chris Angelico rosuav at gmail.com
Thu Jul 24 06:20:59 EDT 2014


On Thu, Jul 24, 2014 at 8:12 PM, Steven D'Aprano <steve at pearwood.info> wrote:
>> Would it be possible to snapshot all critical globals with a closure, to
>> force them to be held? Something like:
>
> Probably. Or even as default argument parameters. But I'd like to know if
> that's actually fixing it or just perturbing the system enough that the
> bug won't show up until next time the moon is full.

If the problem is that there's a circular reference (function to
module, module to function) and stuff's getting cleaned up in
arbitrary order, the snapshotting should cure it, as it's a one-way
reference. But since I can't recreate the exact symptoms you're
seeing, it's hard for me to be sure...

ChrisA



More information about the Python-list mailing list