Re: [PATCH v3] test: replace notmuch_passwd_sanitize() with _libconfig_sanitize()

Subject: Re: [PATCH v3] test: replace notmuch_passwd_sanitize() with _libconfig_sanitize()

Date: Thu, 20 May 2021 10:43:35 +0300

To: Felipe Contreras

Cc: notmuch@notmuchmail.org

From: Tomi Ollila


On Wed, May 19 2021, Felipe Contreras wrote:

> On Wed, May 19, 2021 at 12:34 PM Tomi Ollila <tomi.ollila@iki.fi> 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
>   EOF

According to 

https://unix.stackexchange.com/questions/123602/portability-of-file-descriptor-links

that solution could be portable enough.

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)

Tested the above. That python /dev/fd/3 3<<EOF is so neat it at least
have to be tested to see how it looks like and behaves... :D

>
> -- 
> Felipe Contreras

Tomi
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: