Build error with C locale 4.14rc2

Andrew Bartlett abartlet at
Wed Feb 10 06:36:02 UTC 2021

Yeah, we have so far enforced a UTF8 locale in our build environments. 

Later python versions assume C really means UTF8 but in the meantime
just set that.  A patch to handle this as bytes would probably also be
accepted (via GitLab), but I think this will be a big whack-a-mole.

(And because we enforce UTF8 in the build environments in CI any fix
wouldn't be tested anyway). 


Andrew Bartlett

On Wed, 2021-02-10 at 13:06 +0900, OHKAWA Yuichi via samba-technical
> Hi,
> When I tried to build 4.14rc2 with LC_ALL=C locale, a build error
> have occurred.
> If I used LC_ALL=en_us.utf8, I had no error.
> I guessed that because python3.6 under C locale cannot treat  a latin
> character ö of source4/heimdal/lib/asn1/lex.l.
> ---- error message ----
> [368/418] Compiling source4/heimdal/lib/asn1/lex.l
> Waf: Leaving directory `/builddir/build/BUILD/samba-
> 4.14.0rc2/bin/default'
> Build failed
> Traceback (most recent call last):
>   File "/builddir/build/BUILD/samba-
> 4.14.0rc2/third_party/waf/waflib/", line 350, in process
>     ret =
>   File "./buildtools/wafsamba/", line 30, in flexfun
>     tsk.outputs[0].write(txt.replace('\r\n', '\n').replace('\r',
> '\n')) # issue #1207
>   File "/builddir/build/BUILD/samba-
> 4.14.0rc2/third_party/waf/waflib/", line 201, in write
>     Utils.writef(self.abspath(), data, flags, encoding)
>   File "/builddir/build/BUILD/samba-
> 4.14.0rc2/third_party/waf/waflib/", line 268, in writef
>     data = data.encode(encoding)
> UnicodeEncodeError: 'latin-1' codec can't encode characters in
> position 33323-33324: ordinal not in range(256)
> --- 
Andrew Bartlett (he/him)
Samba Team Member (since 2001)
Samba Team Lead, Catalyst IT

More information about the samba-technical mailing list