From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id KMYLC2Tc2WGxOQAAgWs5BA (envelope-from ) for ; Sat, 08 Jan 2022 19:48:04 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id wLisB2Tc2WHzHQAAauVa8A (envelope-from ) for ; Sat, 08 Jan 2022 19:48:04 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DFCE8141EC for ; Sat, 8 Jan 2022 19:48:03 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 3A7975F728; Sat, 8 Jan 2022 18:48:00 +0000 (UTC) Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by mail.notmuchmail.org (Postfix) with ESMTPS id A47105F717 for ; Sat, 8 Jan 2022 18:47:57 +0000 (UTC) Received: by mail-wr1-x431.google.com with SMTP id v6so17969656wra.8 for ; Sat, 08 Jan 2022 10:47:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version; bh=MoPn97QOvUS7TfStOGfVkbEZ/0gTiNZeTNu5jIUxjQ4=; b=quxbGhZIjyiMnremc8WFBJUUROGV2zxNmQYbflmnaW7ep+n3vv6xIEsVAjm2b2C89/ s6Nwi7f2LXtOkPuchIBYMNU3Lj/mFvmA8NUb/0egLT5Woy78V3s8ye58GvroOPnxXa0x yPfjC+BCY+7A0z391wpadGPIkVwpKdOdQeG/xdx5o1hZqgjAjF3XauoT0PpqygjWX8n6 IH0tg1tF0T4h+1iARUVGyCEKCKEIxY1k/IS1sh0a0qKQN1yCXDQx5rP8KxwXfOngUAyd HvFWM2xcoFg+rcxkvb35Tn+G64UWQUtMJV8fDz00JHh7tnoQ3xCGYY9g1gMht3vwtCd0 ny9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:in-reply-to:references :date:message-id:mime-version; bh=MoPn97QOvUS7TfStOGfVkbEZ/0gTiNZeTNu5jIUxjQ4=; b=vgL+DqWDNseqo359NgQUvgZIIp9XUiwsTx7s+4gnllQIr0Y0LCp2KCsaZOSYUHhLY+ CZ1SwVAhmYMC/P05L97W7If1IJ0b9I5dCbOcSwcAM986ENrbW+SlnX2JZu3eEvEwCUcS agC6dXRTrYlNuWOKDX54oaSUkNcF0rR+cy6q5G37qPj+L3UpdUlFRtaldz4gaVK2pFZy AAu+ds0veiqkCCzrS4IRU1X7tRdtu4Oc9kLJm4Bwh+bTOHnSxQaps6n/9qpXxmWUUS+X 5SUo+bSNPP77LTUate0dxlassh21AD8FkCyst8q6tyhAoB8IwTuHyE16sTHzBV8UhvCP yhNw== X-Gm-Message-State: AOAM533Q5pm7JvyNHfULez2yGiVFIfBLtyNiuaCgCuMbvjdupn9Mi3x1 w53v5jh8UMyObhfMchQ5Bdc= X-Google-Smtp-Source: ABdhPJzaJWneIs7ikL40cY+Uhd0qbCYeh69HARuMHPsw1/WnhnXA5N/rRJkuHN8OatyHHpeeHQObdw== X-Received: by 2002:a05:6000:1e14:: with SMTP id bj20mr13715133wrb.472.1641667677066; Sat, 08 Jan 2022 10:47:57 -0800 (PST) Received: from powell.devork.be (62-178-226-148.cable.dynamic.surfer.at. [62.178.226.148]) by smtp.gmail.com with ESMTPSA id e5sm2514851wrq.116.2022.01.08.10.47.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jan 2022 10:47:56 -0800 (PST) Sender: Floris Bruynooghe Received: (nullmailer pid 201882 invoked by uid 1000); Sat, 08 Jan 2022 18:47:55 -0000 From: Floris Bruynooghe To: David Bremner , Lele Gaifax , notmuch@notmuchmail.org Subject: Re: [PATCH] bindings/python-cffi: search for config by default In-Reply-To: <20220108161913.3117598-1-david@tethera.net> References: <87fsqijx7u.fsf@metapensiero.it> <20220108161913.3117598-1-david@tethera.net> Date: Sat, 08 Jan 2022 19:47:55 +0100 Message-ID: <87czl2awtg.fsf@powell.devork.be> MIME-Version: 1.0 Message-ID-Hash: YW2CRYUHH4QBBUJW552CYY5NLF33BSC4 X-Message-ID-Hash: YW2CRYUHH4QBBUJW552CYY5NLF33BSC4 X-MailFrom: floris.bruynooghe@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1641667683; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=7MQPpJENwN54o1ZgzVhdoax7J4JNQCTgeHms4mLiMpU=; b=k7VxAw4unSZetupALGi/UywV9i84SNxhybU4WRXFsRGcCJraME0uI71pETjHnsdigho7JO L+xJzmg8PPZ7HZiZcHGrhLQDbFsU1QFs8bU1cRWCLUJkCBqiUYmFmhcmpw++tNE9SRkO02 s53j7RT/0Qv8O95Gh7pk+v/+tg3s0aiRwe84G5rxMtVxBG/Q9Cgc0uqKzOAnsHuPjg52Pf pjGaLBQCd3L/0ky9IGAj+VLaI2bxa5/C7auV3ZR/+Yhwog0KuEhL7o0PCg9VIj3qQ1EvPX f2AbbS6SEJUIqWHZBwjV2kDtTKI1QkTppDXpxtDpv+XrQLXud33WqOT0KyfgSA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641667683; a=rsa-sha256; cv=none; b=gn5Vb3gbozwvolsAh9a24NKMD6h2FVxW36srHgUnYC7SRCJ+I1bcscpSBzdsW3TkAEyWn2 ALv9JQV2OttybRNie1ydSvJJD0vC/J9rY2So0KVzIbsYjPJDKIyEKAPM1vsr0WM0dOC4Sw mHX7bcWVr31XpsjegRBLMrQ+m7IV3PK7WhkGZDX+nyj0gKd50h6pCaf/RyBYZnKtPfX39Z WEXvW/ZLxpkTxugPiH5QTW8FbNJjXcAvhNiBAN5e6RV/N1TwFDQyO6swUiQE7SG9KjKVeG /yy34XYUk42z1d4GdbXmytd/NNaQmwRVeo4ZdKj9GtVl9M5/b8d3dBww+Cv1uQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=quxbGhZI; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -2.33 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=quxbGhZI; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: DFCE8141EC X-Spam-Score: -2.33 X-Migadu-Scanner: scn0.migadu.com X-TUID: w/84ZPBPa8uA On Sat 08 Jan 2022 at 12:19 -0400, David Bremner wrote: > The previous (pre-0.34.2) constructor searched for a config file but > only if the database path was not specified, and only to retrieve > database.path. Neither of the available options (CONFIG.SEARCH or > CONFIG.NONE) matches this semantics exactly, but CONFIG.SEARCH causes > less breakage for people who relied on the old behaviour to set their > database.path [1]. Since it also seems like the friendlier option in > the long run, this commit switches to CONFIG.SEARCH as default. > > [1]: id:87fsqijx7u.fsf@metapensiero.it > --- > bindings/python-cffi/notmuch2/_database.py | 2 +- > bindings/python-cffi/tests/test_database.py | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/bindings/python-cffi/notmuch2/_database.py b/bindings/python-cffi/notmuch2/_database.py > index 14a8f15c..d7485b4d 100644 > --- a/bindings/python-cffi/notmuch2/_database.py > +++ b/bindings/python-cffi/notmuch2/_database.py > @@ -139,7 +139,7 @@ class Database(base.NotmuchObject): > path = os.fsencode(path) > return path > > - def __init__(self, path=None, mode=MODE.READ_ONLY, config=CONFIG.EMPTY): > + def __init__(self, path=None, mode=MODE.READ_ONLY, config=CONFIG.SEARCH): > if isinstance(mode, str): > mode = self.STR_MODE_MAP[mode] > self.mode = mode > diff --git a/bindings/python-cffi/tests/test_database.py b/bindings/python-cffi/tests/test_database.py > index 9b3219c0..473723d5 100644 > --- a/bindings/python-cffi/tests/test_database.py > +++ b/bindings/python-cffi/tests/test_database.py > @@ -13,7 +13,7 @@ import notmuch2._message as message > > @pytest.fixture > def db(maildir): > - with dbmod.Database.create(maildir.path) as db: > + with dbmod.Database.create(maildir.path, config=notmuch2.Database.CONFIG.SEARCH) as db: > yield db LGTM