Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!backfill.erje.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'argument': 0.05; 'cure': 0.07; 'subject:skip:s 10': 0.07; 'cc:addr:python-list': 0.11; 'bug': 0.12; '24,': 0.16; 'cleaned': 0.16; 'closure,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'globals': 0.16; 'held?': 0.16; 'one-way': 0.16; 'wrote:': 0.18; 'module': 0.19; 'thu,': 0.19; 'cc:addr:python.org': 0.22; 'circular': 0.24; 'module,': 0.24; 'cc:2**0': 0.24; 'header:In- Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'getting': 0.31; "d'aprano": 0.31; 'fixing': 0.31; 'parameters.': 0.31; 'steven': 0.31; 'critical': 0.32; "i'd": 0.34; 'problem': 0.35; "can't": 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'next': 0.36; 'possible': 0.36; 'should': 0.36; 'pm,': 0.38; 'enough': 0.39; 'even': 0.60; "you're": 0.61; 'show': 0.63; 'default': 0.69; 'jul': 0.74; 'seeing,': 0.84; 'snapshot': 0.84; 'symptoms': 0.84; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=xIsRi8YS+XnUU8m+yjPR758fYP+nvDvOgD9bcyl/bLE=; b=lcA6vIbD+YwYXUATIR6nvgF+lqmDDrS+GiwS2pHlQJcad/D9kHwBrs56Vu5gVJUuQY qU5/i2eXnQZCwgwlBMTRkPwoTMKQqfISqWHhROMaH6arUJi5Vlgj8IJfXVbPzIyt/6kD qlR+OcGuLNyYIDKsnMN+G9B+rlnCHy+vCjZhLwFzRcCP2CdyA4cmlAa846faWp6YgnzU I/OO3ZURrQTcR3Z1ASXYvOav7ckOR0onEjmonamzVos6Hjv8XS9BZ8HPJmWptcDOY1c2 GyKqSgA41EbwAbGwk9LVXWcOur833x6zoNvAU90IIghdZql98zQbbKsxJXpHWt3EWFVk Xj1g== MIME-Version: 1.0 X-Received: by 10.220.166.9 with SMTP id k9mr10785377vcy.20.1406197259678; Thu, 24 Jul 2014 03:20:59 -0700 (PDT) In-Reply-To: <53d0dbff$0$2814$c3e8da3$76491128@news.astraweb.com> References: <53cf60d3$0$29897$c3e8da3$5496439d@news.astraweb.com> <53cf6867$0$29897$c3e8da3$5496439d@news.astraweb.com> <53d061c1$0$29966$c3e8da3$5496439d@news.astraweb.com> <53d0dbff$0$2814$c3e8da3$76491128@news.astraweb.com> Date: Thu, 24 Jul 2014 20:20:59 +1000 Subject: Re: My sys.excepthook dies painfully From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1406197627 news.xs4all.nl 2836 [2001:888:2000:d::a6]:44308 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:75138 On Thu, Jul 24, 2014 at 8:12 PM, Steven D'Aprano 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