[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 06:57:01 -0600
Jonathan Corbet <> escreveu:

> On Thu, 5 Sep 2019 06:23:13 -0300
> Mauro Carvalho Chehab <> wrote:
> > Python's PEP-263 [1] dictates that an script that needs to default to
> > UTF-8 encoding has to follow this rule:
> >
> > 'Python will default to ASCII as standard encoding if no other
> > encoding hints are given.
> >
> > To define a source code encoding, a magic comment must be placed
> > into the source files either as first or second line in the file'
> So this is only Python 2, right? Python 3 is UTF8 by default. Given that
> Python 2 is EOL in January, is this something we should be concerned
> about? Or should we instead be making sure that all the Python we have
> in-tree works properly with Python 3 and be done with it?

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.

Yet, according with PEP, it defaults to off, unless when using POSIX


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