From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 481FB6DE6195 for ; Fri, 16 Mar 2018 04:59:55 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[AWL=0.011, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G06D4i4rrpJ9 for ; Fri, 16 Mar 2018 04:59:54 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 1BBA56DE6194 for ; Fri, 16 Mar 2018 04:59:53 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1ewo1R-00041J-2K; Fri, 16 Mar 2018 07:59:45 -0400 Received: (nullmailer pid 22183 invoked by uid 1000); Fri, 16 Mar 2018 11:59:44 -0000 From: David Bremner To: "W. Trevor King" , Justus Winter <4winter@informatik.uni-hamburg.de> Cc: notmuch@notmuchmail.org Subject: Re: Crash with Python bindings In-Reply-To: <20160112185107.GA21580@odin.tremily.us> References: <5694CA65.8010400@fastmail.net> <20160112102329.4269.20741@thinkbox.jade-hamburg.de> <20160112185107.GA21580@odin.tremily.us> Date: Fri, 16 Mar 2018 08:59:44 -0300 Message-ID: <87k1ucp6xb.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 11:59:55 -0000 "W. Trevor King" writes: > you can avoid the abort (which happens when q.__del__ is called after > db.__del__). We could make that sort of cleanup easier with context > managers for Query objects (we have them for databases since [3]), and > they look like the only object that keep an internal database > reference: > > with Database() as db: > with Query(db, "*") as q: > # do something with q > db.close() > I'm reminded [1] that this problem still exists. If noone has any idea of a fix, should we document one of the workarounds? [1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=893057