[lkml]   [2019]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] docs: license-rules.txt: cover SPDX headers on Python scripts
Em Thu, 5 Sep 2019 13:40:08 -0600
Jonathan Corbet <> escreveu:

> On Thu, 5 Sep 2019 16:28:10 -0300
> Mauro Carvalho Chehab <> wrote:
> > I don't think we can count that python 3 uses utf-8 per default.
> >
> > I strongly suspect that, if one uses a Python3 version < 3.7, it will
> > still default to ASCII.
> >
> > On a quick look, the new UTF-8 mode was added on PEP-540:
> >
> >
> >
> > Such change happened at Python 3.7.
> That PEP is to override the locale and use utf8 unconditionally. It
> says, with regard to the pre-PEP state:
> UTF-8 is also the default encoding of Python scripts, XML and JSON
> file formats.
> Unicode was the reason for much of the Python 3 pain; it seems unlikely
> that many installations are defaulting to ASCII anyway...?

Yeah, but I remember that UTF-8 handling changed a few times during python 3
releases. I didn't really tracked what happened, as I don't usually program
in Python. So, I'm actually relying on what I can find about that.

Looking at Python 3.0 release[1], it says:

"In many cases, but not all, the system default is UTF-8;
you should never count on this default."


So, at least on early Python 3 releases, the default may not be UTF-8.

I don't know about you, but, from time to time, people complain about
UTF-8 chars when I'm handling patches (last time was on a patch series
for Kernel 5.3 by a core dev in Australia, with was unable to apply a
patch from me with had some UTF-8 chars).

So, I'm pretty sure that some devs don't set the locale to UTF8 even
those days.


 \ /
  Last update: 2019-09-05 22:08    [W:0.095 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site