Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #12214

Re: dh_python3 sets shebang to Python 2 -- is this a bug?

Path csiph.com!news.mixmin.net!news.albasani.net!tahina.priv.at!bofh.it!news.nic.it!robomod
From Nicholas D Steeves <nsteeves@gmail.com>
Newsgroups linux.debian.maint.python
Subject Re: dh_python3 sets shebang to Python 2 -- is this a bug?
Date Wed, 22 Jan 2020 02:20:01 +0100
Message-ID <zrcQx-5X5-3@gated-at.bofh.it> (permalink)
References <zqIps-4sJ-15@gated-at.bofh.it> <zqIps-4sJ-13@gated-at.bofh.it>
X-Mailbox-Line From debian-python-request@lists.debian.org Wed Jan 22 01:18:38 2020
Old-Return-Path <nsteeves@gmail.com>
X-Amavis-Spam-Status No, score=-12.099 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FOURLA=0.1, FREEMAIL_FROM=0.001, LDO_WHITELIST=-5, PGPSIGNATURE=-5, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham autolearn_force=no
X-Policyd-Weight using cached result; rate: -5.5
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:date:message-id:mime-version; bh=QClcNpFC07vL4m1PneUrlID5hpTcJYRMuqBCcAO4iAg=; b=humnb05iieUxq1DZbFaxu9R//yM9PYDeB3V6+rWOfA9bF3hT95IEUTEIRRSo1eXPZC NpW2dUum++WwQBHGktiOmtHoSn1pev4euGupmAin6E5tKreKWLDKE5qEtMpYQKfLLiZ3 d4YgmDhPnnZDbqW5AMerevbAJQwAcE/4fr29dM8OYtFhQ2cpIWXZm/Jja6Aqlfzym3Z4 KWua5nC+QrNSrJsTq7pDS44oTOALjcU3sQQNyihgZJxEtCwBFHl4ekbuLcmwMxTAlinD jahatSlDaAPsDR263g6mmUH6jA1GeQPm5pAQiXYIdx1h/rTWpUUsPa45pakBjw23Xl5o quvw==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=QClcNpFC07vL4m1PneUrlID5hpTcJYRMuqBCcAO4iAg=; b=hIGRczjCykKV54y4iINrFtBNaxBe/B3zS0tpO8MdAZ3k5PTm0s80x2dkWcI54S+kme LmZJQDGlhG6ET/4ZDkoL90pdtAmd2BDc2LDXDKKfTUef9IZlR4wwpgK+a2CfgK2EgydP F6efxLuEVRfJKy6iKLDEsGInoT+JdgSWVg9pOYO3djBspWNQkXkDiaGJTIgAYPFWJgwH mZ/xRdy9ESjfiAyoIVrtGZgbSSb1v7BV6BlYzJMiUDyBAnYeubu+Gohll9ZZLSJGJ0mm pjFXyiMTdzSmUwNPxun6ax2UrvFSPet2eeIFaQOKvumAyQEv2xtWYHlOKwJn/8IYsb0X PJcA==
X-Gm-Message-State APjAAAVNaPlsLZ6uUbHxnkKns0UDoMM3cpy5btxy04MDoFscdflB4eKT o2077qgTXKwaXhqfD7swnMs1Xacv
X-Google-SMTP-Source APXvYqyapipmV7ThCXPiPAEYC+cQxs8Yg9bleToIvUAcUgPPQeQCz6chQ5qpT7We9iOQhd83ciuwvQ==
X-Received by 2002:a17:902:b210:: with SMTP id t16mr8105338plr.65.1579655902370; Tue, 21 Jan 2020 17:18:22 -0800 (PST)
MIME-Version 1.0
Content-Type multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature"
X-Mailing-List <debian-python@lists.debian.org> archive/latest/17830
List-ID <debian-python.lists.debian.org>
List-URL <https://lists.debian.org/debian-python/>
List-Archive https://lists.debian.org/msgid-search/877e1kqof7.fsf@gmail.com
Approved robomod@news.nic.it
Lines 65
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Date Tue, 21 Jan 2020 18:18:20 -0700
X-Original-Message-ID <877e1kqof7.fsf@gmail.com>
X-Original-References <8617164e-c018-608b-8e20-ec873756135a@debian.org> <20200120164044.ip32pv3aergudp4p@fatal.se>
Xref csiph.com linux.debian.maint.python:12214

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi,

Andreas Henriksson <andreas@fatal.se> writes:

> I've personally seen some upstream use 'python' in shebang with the
> intention of meaning 'works with either python2 or python3',

Yes, this has worked thus far, and it will definitely work in cases where
`which python` is a symlink to python3 within a virtual environment.

>  but in debian it seems people have always assumed unversioned
> (/usr/bin/)python always means python *2*.

I don't think this is an assumption.  Debian adheres to PEP 394, which
until recently said that /usr/bin/python is supposed to be Python 2, for
backwards compatibility.  When I discovered this I felt increased trust
in Debian and its developers for doing the sensible and standardised
thing, rather than what some other distributions have done.  To everyone
involved, thank you!  This also made me proud to be part of such a
community :-)

  https://www.python.org/dev/peps/pep-0394/

I believe that it was on 26-Jun-2019 of this year that PEP 394 was
modified to allow /usr/bin/python to be py3, because py2 EOL frees
up this path.  IMHO that change was premature and should have been
deferred until the actual EOL.

> I guess the tools are written in the latter sense here, rewriting the
> shebang from python -> python2 explicitly unless you override it....
>

Yeah, this is a tricky point.  Per PEP 394 (until py2 EOL), this is the
correct approach, but now it may make more sense to change this to
"python -> python3", because if this breaks a package, tough luck, we're
in a python3-only world.  eg: packages in the archive should already
have the shebang override, and NEW py2 packages will be rejected by
ftpmasters.

Cheers,
Nicholas

Back to linux.debian.maint.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: dh_python3 sets shebang to Python 2 -- is this a bug? Andreas Henriksson <andreas@fatal.se> - 2020-01-20 17:50 +0100
  Re: dh_python3 sets shebang to Python 2 -- is this a bug? Nicholas D Steeves <nsteeves@gmail.com> - 2020-01-22 02:20 +0100
    Re: dh_python3 sets shebang to Python 2 -- is this a bug? Matthias Klose <doko@debian.org> - 2020-01-23 14:20 +0100

csiph-web