Eaten by autobuild?

SATOH Fumiyasu fumiyas at osstech.co.jp
Wed Nov 11 13:01:33 UTC 2020


On Tue, 10 Nov 2020 17:21:17 +0900,
samba-technical at lists.samba.org wrote:
> How about the following patches?

Demo:

```
$ cat t.py
#!/usr/bin/env python3

from email.mime.text import MIMEText

text = 'Blah-Blah' * 10
msg = MIMEText(text, 'plain', 'UTF-8')
print(msg)
msg = MIMEText(text, 'plain')
print(msg)
$ python3 t.py
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64

QmxhaC1CbGFoQmxhaC1CbGFoQmxhaC1CbGFoQmxhaC1CbGFoQmxhaC1CbGFoQmxhaC1CbGFoQmxh
aC1CbGFoQmxhaC1CbGFoQmxhaC1CbGFoQmxhaC1CbGFo

Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

Blah-BlahBlah-BlahBlah-BlahBlah-BlahBlah-BlahBlah-BlahBlah-BlahBlah-BlahBlah-BlahBlah-Blah
```

> From b51714389dea766a49118187c5954b7ccaf92587 Mon Sep 17 00:00:00 2001
> From: SATOH Fumiyasu <fumiyas at osstech.co.jp>
> Date: Tue, 10 Nov 2020 17:15:42 +0900
> Subject: [PATCH] autobuild: Encode text/plain into base64 to wrap long-lines
> 
> MIMEText(text, 'plain', 'utf-8') encodes the text into
> base64 and adds 'Content-Transfer-Encoding: base64' header.
> ---
>  script/autobuild.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/script/autobuild.py b/script/autobuild.py
> index 24baa0fa9f2..a76309df8a2 100755
> --- a/script/autobuild.py
> +++ b/script/autobuild.py
> @@ -1112,7 +1112,7 @@ def send_email(subject, text, log_tar):
>      outer['From'] = options.email_from
>      outer['Date'] = email.utils.formatdate(localtime=True)
>      outer.preamble = 'Autobuild mails are now in MIME because we optionally attach the logs.\n'
> -    outer.attach(MIMEText(text, 'plain'))
> +    outer.attach(MIMEText(text, 'plain', 'utf-8'))
>      if options.attach_logs:
>          with open(log_tar, 'rb') as fp:
>              msg = MIMEApplication(fp.read(), 'gzip', email.encoders.encode_base64)
> -- 
> 2.29.1
> 
> On Tue, 10 Nov 2020 15:51:47 +0900,
> samba-technical at lists.samba.org wrote:
> > 
> > When your autobuild is eaten, remember to check autobuild.log.
> > 
> > I didn't get an autobuild failure mail because that comes from the
> > autobuild script, which failed to fire out the mail:
> > 
> > Traceback (most recent call last):
> >   File "script/autobuild.py", line 1324, in <module>
> >     elapsed_time, log_base=options.log_base)
> >   File "script/autobuild.py", line 1197, in email_failure
> >     text, logs)
> >   File "script/autobuild.py", line 1130, in send_email
> >     s.sendmail(options.email_from, [options.email], content)
> >   File "/usr/lib/python3.6/smtplib.py", line 888, in sendmail
> >     raise SMTPDataError(code, resp)
> > smtplib.SMTPDataError: (550, b'maximum allowed line length is 998
> > octets, got 1756')
> > 
> > This is because of this lovely line, which it wanted to put into the mail as context for the failure:
> > test: running (/usr/bin/perl /m/abartlet/aMASTER/b2752753/samba-o3/selftest/selftest.pl --target=samba --prefix=./bin/ab --srcdir=/m/abartlet/aMASTER/b2752753/samba-o3 --exclude=/m/abartlet/aMASTER/b2752753/samba-o3/selftest/skip --testlist="/usr/bin/python3 /m/abartlet/aMASTER/b2752753/samba-o3/selftest/tests.py|" --testlist="/usr/bin/python3 /m/abartlet/aMASTER/b2752753/samba-o3/source3/selftest/tests.py|" --testlist="/usr/bin/python3 /m/abartlet/aMASTER/b2752753/samba-o3/source4/selftest/tests.py|"  --exclude=/m/abartlet/aMASTER/b2752753/samba-o3/selftest/slow --nss_wrapper_so_path=/m/abartlet/aMASTER/b2752753/samba-o3/bin/default/third_party/nss_wrapper/libnss-wrapper.so --resolv_wrapper_so_path=/m/abartlet/aMASTER/b2752753/samba-o3/bin/default/third_party/resolv_wrapper/libresolv-wrapper.so --uid_wrapper_so_path=/m/abartlet/aMASTER/b2752753/samba-o3/bin/default/third_party/uid_wrapper/libuid-wrapper.so --socket_wrapper_so_path=/m/abartlet/aMASTER/b2752753/samba-o3/bin/defaul
 t/third_party/socket_wrapper/libsocket-wrapper.so --socket-wrapper --exclude=selftest/slow-none --include-env=none && touch ./bin/ab/st_done) | /usr/bin/python3 -u /m/abartlet/aMASTER/b2752753/samba-o3/selftest/filter-subunit --expected-failures=/m/abartlet/aMASTER/b2752753/samba-o3/selftest/knownfail --expected-failures=/m/abartlet/aMASTER/b2752753/samba-o3/selftest/knownfail.d --flapping=/m/abartlet/aMASTER/b2752753/samba-o3/selftest/flapping --flapping=/m/abartlet/aMASTER/b2752753/samba-o3/selftest/flapping.d --fail-immediately --expected-failures=/m/abartlet/aMASTER/b2752753/samba-o3/selftest/knownfail_heimdal_kdc | tee ./bin/ab/subunit | /usr/bin/python3 -u /m/abartlet/aMASTER/b2752753/samba-o3/selftest/format-subunit --prefix=./bin/ab --immediate
> > LD_PRELOAD=/m/abartlet/aMASTER/b2752753/samba-o3/bin/default/third_party/nss_wrapper/libnss-wrapper.so:/m/abartlet/aMASTER/b2752753/samba-o3/bin/default/third_party/resolv_wrapper/libresolv-wrapper.so:/m/abartlet/aMASTER/b2752753/samba-o3/bin/default/third_party/socket_wrapper/libsocket-wrapper.so:/m/abartlet/aMASTER/b2752753/samba-o3/bin/default/third_party/uid_wrapper/libuid-wrapper.so
> > 
> > Just in the hope this helps someone else (or someone knows how to fix it).
> 
> -- 
> -- Name: SATOH Fumiyasu @ OSS Technology Corp. (fumiyas @ osstech co jp)
> -- Business Home: https://www.OSSTech.co.jp/
> -- GitHub Home: https://GitHub.com/fumiyas/
> -- PGP Fingerprint: BBE1 A1C9 525A 292E 6729  CDEC ADC2 9DCA 5E1C CBCA
> 



More information about the samba-technical mailing list