From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uFttOHL6p2CczgAAgWs5BA (envelope-from ) for ; Fri, 21 May 2021 20:22:42 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id oBcUNHL6p2A1UAAAbx9fmQ (envelope-from ) for ; Fri, 21 May 2021 18:22:42 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (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 DFA901938E for ; Fri, 21 May 2021 20:22:41 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id DF0C8271D5; Fri, 21 May 2021 14:22:36 -0400 (EDT) Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [IPv6:2a0b:5c81:1c1::37]) by mail.notmuchmail.org (Postfix) with ESMTPS id C2ED327169 for ; Fri, 21 May 2021 14:22:34 -0400 (EDT) Received: from guru.guru-group.fi (unknown [IPv6:2a02:2380:1:9:5054:ff:feb7:a4bc]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: too) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id D1E1C1B002B6; Fri, 21 May 2021 21:22:28 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1621621348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cfedTDyyrSEe8aalbu8gu2IsnGhVo7kmaNkGkXhPG1Y=; b=wH5++fOuDoFUw+K28bIcJExWWtB7k3iHBkME/5xULTeU/JdEE7c6g1l1Wtt2u1OBgkZcCC xwaZTxNcTukj+JYDa1SPMPFRnn7rzF1cugvDZrjvuRpNZC/E4hLpB8COyAHuzxA5pF7tge b4nn4TWAF+IQyzrAhIfHoGyW05czsVJJXPERn0edl0vS0V5LrNzXxWCAQIwqwiVB7zjdey leHxZFHW/7AJv1D/aZYUEwb0MlBKCGLaZASQSKqoIVzUttVVF3UbJyLrOY2RK6dwrbwZy3 112c8rPNhsccTrUsojIMLgyDFTsZC+pE+fzFUwP/HRhQnZ/XmhJku5AKO3isoA== From: Tomi Ollila To: Felipe Contreras Subject: Re: [PATCH v3] test: replace notmuch_passwd_sanitize() with _libconfig_sanitize() In-Reply-To: References: <20210518055443.21964-1-tomi.ollila@iki.fi> User-Agent: Notmuch/0.32+21~gfdddd4c (https://notmuchmail.org) Emacs/27.1 X-Face: HhBM'cA~ MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1621621348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cfedTDyyrSEe8aalbu8gu2IsnGhVo7kmaNkGkXhPG1Y=; b=WqTN18CEVx5W5Mh6aJz+3/gfGXMR8PsVEqJa3k0ZioIQR4zderrBUVANezynvayxpmkXq6 3fw0/85bUtpp4IKX+o/4n5RJQms1BwsTKt+FPeRL+wV0cr6JgK3NmOlk8LO0mXLirttFpk e2BeQ/RPKRB/Ia2LEO8ggw66c/B2UEmI9cWqe7mkdiSqxBnFUYTiicTcrjuWdPrlZt2ui0 +XFPAMpKE6f7Yk913/BNEMb7a42TsClYShzBIbpdtWaw7r7j5zMyyLGv03fXriekDSBBgg LeL/lSZMOpnr3QsNEbqLPtlNJkzXGrfiiPyqxaisp+ZYLze9lC3uhePJxdY7uQ== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1621621348; a=rsa-sha256; cv=none; b=kVWWYb9+WFBzBMJK+DHJ96IaVfO/usVW4EFZg9f2SMrApZQbPnyMkVOG+MCQpvTID1Xxl7 MqriotEG5qp5R3c1AhQrOjy9SMdyRFm0FiJZu6QV0bQr1d1wnFkrQtUhiIbeGsg7dzRVL7 eMFxCg+u42v3oRsbV1HaU27leIbFEHBC7Kn6WFQWRhithDZXALFe0JtS4VpohjjChmMwiM lKLQhTQBtZYLb2wJ5Q+5x71SmLldo13ggorYeLOUd9o5aCZ0SEP4mWMHdS5zzSyhoElUNI ehtSFPLCIH5WGd4yJgTfEarMalCooEo94KEunhz/6rxiKM4jHDXBLwhI28q8iw== Message-ID-Hash: BGQMGIG4LIWFJUHMTGYMDZE3O4DNE5WY X-Message-ID-Hash: BGQMGIG4LIWFJUHMTGYMDZE3O4DNE5WY X-MailFrom: tomi.ollila@iki.fi 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; suspicious-header CC: "notmuch@notmuchmail.org" X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1621621362; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc: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-unsubscribe:list-subscribe:list-post:dkim-signature; bh=gH9wZWC7Bwyik7lvJ3eS5p8qhXd40wBSsyYFlNQUT80=; b=QzBmVHtuBjQhUOs4s+3FQV2N1FhTCBnsDvPQHgjwvamX5gt9rgKql5JtoXFScpsRf/lV7a E5W08csopBJz4qkJCbfB9rk1B2q9Ynomy+i5GLhsr42YptekzbPbhfmQmTpzhnIiH7th+3 mnYmnOBzZtWaFBoMTiCCsq2oceyIjrj3whTNxt9QCI+cAAhtERhZ75RA05Kr/s1Fw3fVIi 6RooCzFrAsGuOI/I7LYTuTLXt2QFSKTSE4C5HqFMOPKWytSIRfZRyxmVilrxxTRiOPMwj/ XAvAJWGDzew9cgpyL+qcLZslEyFFqdyUipeOOegJjGebrJ4PgDVySfFccdVB4w== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1621621362; a=rsa-sha256; cv=fail; b=ls2wERPWbZobIJRFDi8iKKGXSWK7ZVyRzTxTFxT1ONuO2HbWLv8BWaf4Iqd8BoVVB9veyM 6gQ5Q7fassBXl0nEclTEnZtGHYOF04EdVzOkE9D3Q6ri+6zA3G8kgPkL21DR2SAEIlw3Rt DHBxqsTNdi4Ram7l6U0lI0olDzbpEDT2B9gKUQXITM4SlitiXyUmS12XgV2+yy1LVoi9Hf O+SrXK9YbEZmrDfokXImddHJ9ln885Djhx8E1Ghc+enuDDJKoxRDF+A/ZnBj21rLiMqWGO PXu/miXfuEiHfs3OyvG/iYSU88NBfSfPvNt6HaMxaMLuJ08t25VMHpcyTv6OHQ== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=wH5++fOu; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 0.93 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=wH5++fOu; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: DFA901938E X-Spam-Score: 0.93 X-Migadu-Scanner: scn1.migadu.com X-TUID: 8W1Gid5PYQOk On Fri, May 21 2021, Felipe Contreras wrote: > On Thu, May 20, 2021 at 2:43 AM Tomi Ollila wrote: >> >> On Wed, May 19 2021, Felipe Contreras wrote: >> >> > On Wed, May 19, 2021 at 12:34 PM Tomi Ollila wrote: >> > >> >> Haha, as we do _libconfig_sanitize < OUTPUT > OUTPUT.clean >> >> reading python script from stdin don't work (perl has __DATA__ ;). >> >> (bitten again, I did and tested the change... :D). >> > >> > That can be fixed with: >> > >> > python /dev/fd/3 3<> > EOF >> >> According to >> >> https://unix.stackexchange.com/questions/123602/portability-of-file-descriptor-links >> >> that solution could be portable enough. > > What the operating system does doesn't really matter, bash emulates /dev/fd/x: In this case, /dev/fd/3 is given as a parameter to a command, not part of redirections -- bash cannot know how the program is going to use the arguments it gets... Anyway, the [PATCH v4] in id:20210520134628.11653-1-tomi.ollila@iki.fi implemented your suggestion ${NOTMUCH_PYTHON} /dev/fd/3 3<<'EOF' ... > "If the operating system on which Bash is running provides these > special files, bash will use them; otherwise it will emulate them > internally with the behavior described below." > > https://www.gnu.org/software/bash/manual/html_node/Redirections.html ... "Bash handles several filenames specially when they are used in redirections, as described in the following table." is just before your snippet >;D > > And as far as I know the testing framework only works correctly on bash... So... > >> Another way still using -c ... I've played to look how it actually looks is >> (diff since patch v3) >> >> - sq = chr(39) # single quote >> - l = l.replace(sq + name, sq + "USER_FULL_NAME", 1) >> + l = l.replace("'\''" + name, "'\''USER_FULL_NAME", 1) > > Yes, that works too. But that's what I said in another mail that is > weird stuff. I had to read it again three times and then copy to a > proper text editor with monospace font to see if it was correct. To me '\'' is /idiomatic/ way to embed ' in the middle of a long argument string... >> Tested the above. That python /dev/fd/3 3<> have to be tested to see how it looks like and behaves... :D > > Yeap. Took me a while to find the right documentation to figure that > out, but in my opinion it's better to write a helper for the tests > once, and then forget about it and just re-use it for all. > > -- > Felipe Contreras