Package: git-buildpackage Tags: patch Followup-For: Bug #883541 Hi,
I'm not sure if there is a bug in the python3 implementation of the email.message.Message class, but I've found that retrieving the message as bytes instead of a string restores the original behaviour. Unfortunately, the API doesn't allow you to specify a maximum header length as in as_string. See attached patch. Best regards, Carlos -- System Information: Debian Release: buster/sid APT prefers unstable APT policy: (990, 'unstable'), (1, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.14.0-1-amd64 (SMP w/2 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages git-buildpackage depends on: ii devscripts 2.17.11 ii git 1:2.15.1-2 ii man-db 2.7.6.1-4 ii python3 3.6.4~rc1-2 ii python3-dateutil 2.6.1-1 ii python3-pkg-resources 38.2.4-2 Versions of packages git-buildpackage recommends: ii cowbuilder 0.85 ii pbuilder 0.229 ii pristine-tar 1.42 ii python3-requests 2.18.1-1 ii sbuild 0.73.0-4 Versions of packages git-buildpackage suggests: ii python3-notify2 0.3-3 ii sudo 1.8.21p2-3 ii unzip 6.0-21 -- no debconf information
>From 016458b0db82df220f97a1f3821a0e48f9e1f941 Mon Sep 17 00:00:00 2001 From: Carlos Maddela <e7ap...@gmail.com> Date: Wed, 20 Dec 2017 16:21:49 +1100 Subject: [PATCH] Prevent encoding patch headers in base64. --- gbp/scripts/common/pq.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gbp/scripts/common/pq.py b/gbp/scripts/common/pq.py index 004c231..d092565 100644 --- a/gbp/scripts/common/pq.py +++ b/gbp/scripts/common/pq.py @@ -177,7 +177,7 @@ def write_patch_file(filename, commit_info, diff): msg.set_payload(body.encode('us-ascii')) except (UnicodeEncodeError): msg.set_payload(body, charset) - patch.write(msg.as_string(unixfrom=False, maxheaderlen=77).encode('utf-8')) + patch.write(msg.as_bytes(unixfrom=False)) # Write diff patch.write(b'---\n') -- 2.15.1