Path: csiph.com!news.mixmin.net!news.albasani.net!tahina.priv.at!bofh.it!news.nic.it!robomod From: Nicholas D Steeves 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: References: X-Mailbox-Line: From debian-python-request@lists.debian.org Wed Jan 22 01:18:38 2020 Old-Return-Path: 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: archive/latest/17830 List-ID: List-URL: 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 --=-=-= Content-Type: text/plain Hi, Andreas Henriksson 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE4qYmHjkArtfNxmcIWogwR199EGEFAl4notwACgkQWogwR199 EGH5bw/+OrH2N0XxUGQyONrkzR6kzJgByzehf7rZ+KNfXoJ/an8pGZj1CTlV2Glv jw8TxB0FxMkZYUgsd3iyi+Zp48pDFhip7dVMTVshme+QVRDSJ7a6UiDOx4dCHOcc LhU9VVkEYmp9a2RVdhx2CbjmpSQvYR8Zs4+vD6wEdb3FA3/HBPMkARGlvHYR3DSn Vbo9CxGx7Zbd4JOMAObGaKQpJTbqu4FNd/8Xz8+LPf9N51K8DCsfS2+xjur+99Ae 8wnc4bVIg1AM087BTzlvM3TU5vdEvzYI5puorpFnNY24CjyGOGOGTuuIb5C00sls /6eR4q+FcLWtbz+im/Zz3C/7Jw84s5EP8MEVVOOYlv7KWZyxJBNkqxWW+35K+Xpv GbI2Z1oh9QERxOxT0MfIX8lGA8w5JM27hyUHIjT71XndJjhfE2OqdzqcUhHYbkxa FU8xG4mklrX4fReOI4O3Ysb4gRfKbL9X/wjk4E5SdZYXPs2AHXjDQn/Mx63jyh7r Q/kOGU96ozpCSf//CEWWDNX2bIYBdoo3yCkXwlcwnGmDVu2dfdBDeMGOykaVJG+z 52bH3vawi7rUj42ZEDuYNRKrZR3dASFRRfN9MyTeRvv9eHDn0TYmxSDzqR+dq8vh qELg74Ajo16524hOT301KJlYrw1XJN+/Ul162CNVpU8kidnzMDQ= =DRbO -----END PGP SIGNATURE----- --=-=-=--