#1000865 git-buildpackage: gbp pq: should export non-ASCII authors as UTF-8, without quoted-printable or base64

#1000865#5
Date:
2021-11-30 11:59:16 UTC
From:
To:
To reproduce: add patches to the patch series whose author has a non-ASCII
name, for example commit b01f371ce61f8077bb70a2b6024f4163fafffc5c in
GTK 3, from Nelson Benítez León; then `gbp pq export`.

Expected result: Debian packaging is an 8-bit-clean format that expects
UTF-8, so the patch in debian/patches should have
"From: Nelson Benítez León <email address here>", encoded in UTF-8.

Actual result: the Python modules used by gbp pq assume a 7-bit email
transport, and the patch in debian/patches starts with
"From: =?utf-8?b?TmVsc29uIEJlbsOtdGV6IExlw7Nu?= <email address here>",
which is not very good from the perspective of crediting the appropriate
author or human-readability of the patch.

Names with fewer non-ASCII characters end up in quoted-printable rather
than base64, for example Timm Bäder -> =?utf-8?q?Timm_B=C3=A4der?=, which
is slightly more readable but still not great.

Would it be possible to tell the email modules to avoid using this encoding,
or explicitly decode UTF-8 in the email headers during DEP-3 formatting?

Thanks,
    smcv

#1000865#10
Date:
2022-02-11 13:55:08 UTC
From:
To:
Hi,

I'd welcome patches here.
Cheers,
 -- Guido

#1000865#15
Date:
2022-03-17 13:19:12 UTC
From:
To:
Control: tags -1 + patch

Try these?

I initially tried to do this with the Python-3.2-compatible ("Compat32")
interface that gbp-pq was already using, but couldn't work out how, and
using the modern interface seemed simpler and more future-proof anyway.

This might potentially make git-buildpackage incompatible with Python 3.5,
which it currently declares support for (the "new" interface was considered
provisional in 3.4 and 3.5, and only finalized in 3.6), but 3.5 has been
EOL since 2020 anyway.

test.diff might be useful while testing this. I can successfully `git am`
and `gbp pq export` it, with UTF-8 encoding.

    smcv

#1000865#22
Date:
2022-03-19 01:27:19 UTC
From:
To:
Control: tags -1 - patch
pseudo-headers like Bug-Debian, which corrupts the URLs. This will need
some more work.

    smcv

#1000865#29
Date:
2026-01-10 10:08:08 UTC
From:
To:
Es gibt eine Familienspende in Höhe von 1.850.000,00 USD von Cheng Charlie
Saephan. Bitte antworten Sie für weitere Informationen. Denken Sie daran,
Ihrer Familie und den Bedürftigen in Ihrer Umgebung Gutes zu tun.

Dies ist bereits der zweite Versuch, Sie zu erreichen. Bitte antworten Sie
für weitere Details.

#1000865#34
Date:
2026-01-10 10:08:08 UTC
From:
To:
Es gibt eine Familienspende in Höhe von 1.850.000,00 USD von Cheng Charlie
Saephan. Bitte antworten Sie für weitere Informationen. Denken Sie daran,
Ihrer Familie und den Bedürftigen in Ihrer Umgebung Gutes zu tun.

Dies ist bereits der zweite Versuch, Sie zu erreichen. Bitte antworten Sie
für weitere Details.