Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Brain fried -- Core dumped


devel / comp.lang.python / Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

SubjectAuthor
o Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work Thomas Passin

1
Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

<mailman.38.1705246377.15798.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=24840&group=comp.lang.python#24840

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: lis...@tompassin.net (Thomas Passin)
Newsgroups: comp.lang.python
Subject: Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3
doesn't work any more
Date: Sun, 14 Jan 2024 09:53:58 -0500
Lines: 80
Message-ID: <mailman.38.1705246377.15798.python-list@python.org>
References: <8808f1aa-d707-44b1-98fa-36331e04a50f@web.de>
<F1CB1FD3-4F43-484A-909D-18C20EE32762@barrys-emacs.org>
<f9532b2c-dcc6-40ae-a632-b3a39b5beb69@web.de>
<65F119FD-4B27-4EB3-89FA-07B50F809596@barrys-emacs.org>
<8dcf3464-e32f-457b-8938-0ff013ed4262@web.de>
<40c0fb26-6865-4a2f-8f7c-586d0ed4d23d@tompassin.net>
<bd50cbc9-48d8-4d1d-9dee-43323281ceb5@tompassin.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de Vq6SIlMmUuPZc5+2OVm6PAAGhUHfnPlt8E522MZuoAmg==
Cancel-Lock: sha1:6VJeiKhpy9+2tXHoXMvRZtppTxo= sha256:jHP/ErPdECRn9Qh8ZwOuF+eXCHdAev4MHvk78RrcVZI=
Return-Path: <list1@tompassin.net>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=tompassin.net header.i=@tompassin.net header.b=FpJ74g7w;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.003
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'argument': 0.04;
'windows,': 0.05; 'matching': 0.07; 'subject:Windows': 0.07;
'"python"': 0.09; '*not*': 0.09; '11.': 0.09; 'commands.': 0.09;
'meant': 0.09; 'schrieb': 0.09; 'subject:Python': 0.12;
'supported': 0.15; '>>>>': 0.16; 'barry': 0.16; 'behaviour': 0.16;
'both.': 0.16; 'computers.': 0.16; 'corresponds': 0.16;
'executable': 0.16; 'found,': 0.16; 'happening.': 0.16;
'interpreter': 0.16; 'oh,': 0.16; 'received:10.0.0': 0.16;
'received:64.90': 0.16; 'received:64.90.62': 0.16;
'received:64.90.62.162': 0.16; 'received:dreamhost.com': 0.16;
'specify': 0.16; 'subject:usr': 0.16; 'wrote:': 0.16; 'python':
0.16; 'to:addr:python-list': 0.20; "i've": 0.22; 'creates': 0.22;
"what's": 0.22; 'version': 0.23; 'install': 0.23; 'command': 0.23;
'installed': 0.23; 'lines': 0.23; 'run': 0.23; 'python,': 0.25;
'cannot': 0.25; 'seems': 0.26; 'tried': 0.26; 'configure': 0.26;
"isn't": 0.27; '>>>': 0.28; 'version.': 0.28; 'header:User-
Agent:1': 0.30; 'seem': 0.31; 'am,': 0.31; 'program,': 0.31;
'program': 0.31; 'think': 0.32; "doesn't": 0.32; 'do.': 0.32;
'python-list': 0.32; 'received:10.0': 0.32;
'received:mailchannels.net': 0.32;
'received:relay.mailchannels.net': 0.32; 'specified': 0.32; 'but':
0.32; 'there': 0.33; 'path': 0.33; 'windows': 0.34; "didn't":
0.34; 'mean': 0.34; 'header:In-Reply-To:1': 0.34; '"the': 0.35;
'handling': 0.35; 'files': 0.36; 'special': 0.37; 'really': 0.37;
'file': 0.38; 'way': 0.38; 'read': 0.38; 'thanks': 0.38; 'two':
0.39; 'use': 0.39; 'program.': 0.40; 'four': 0.60; 'search': 0.61;
'between': 0.63; 'complete': 0.64; 'your': 0.64; 'look': 0.65;
'header:Received:6': 0.67; 'received:64': 0.67; 'further': 0.69;
'skip:/ 10': 0.69; 'depending': 0.70; 'virtual': 0.71; 'skip:\xe2
10': 0.71; 'details.': 0.76; 'dead': 0.81; '"to': 0.84; 'handled':
0.84; 'lines,': 0.84; 'scott': 0.84; 'subject: \n ': 0.84;
'subject:bin': 0.84; 'url:windows': 0.84; 'duplicate': 0.93;
'performs': 0.93; 'subject:more': 0.95
X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1705244040; a=rsa-sha256;
cv=none;
b=Kmby5B7vG8y9OmwJw8ujb81aJJBxrJwFSAyySqBOYipqPF55e2RIXNi0HiEQWr7DqruSyp
puBWKi2A4AkdprZsEU72lJe12wOSs24pSN1lDY07oNb84/AeEJe1Kd24Gk8AOAZX0xz4cJ
ZjS/tRXZdV09FBCC7nmjmAcjEA012SJuHZM2Aola0PB5bNljIL6TBSyTXQmqqa1p0a4RM9
9ZIkYhYMXS+vqWCp2nC5w2Z+h3CpdiSW/DSVCxYOyuFxuo8a5JIzRtRnCKrzvfKqMbLMwJ
B22+oytLiotQAMpBnTopRSQU7pSbzHlJLn3PaOVRZB585oDXk3W0ZcWqh51Ssg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
d=mailchannels.net; s=arc-2022; t=1705244040;
h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
to:to:cc:mime-version:mime-version:content-type:content-type:
content-transfer-encoding:content-transfer-encoding:
in-reply-to:in-reply-to:references:references:dkim-signature;
bh=yDnhf/S/sOfRo9pHgrL1vZOujaRZSf1DoOlHY/E7oZ0=;
b=ffi17GIChmV/+gPcxAn8qmNvj7dUrVdvxANF/4fhmRXkyVBXCHhF/OPHbItfoW664+mZep
0IDVIeVfWYlWV9HbSU5bfwV0kyG/AXFA4Wz8hdASq7OudNPabMQ6eJG1bPqSIXuthm1Yzn
p43hpwihlUw/clWJFozbOW7mlVaCASDbgGj4H9G5RbIbEh36Ykcx+carC2SSea52HO8PVT
wl66c0lzHnX0stf2XmUbiKNDI9Wfyc17d7aSwUsUB0X/RjT5TICUrgF8BCKozXxe+ZoqBZ
EZjxtyJl7BxBtcIZwwQOwDEClb/FT8DLrDrSCdvpF2KCKHgEAwx3OFrk9KMEGg==
ARC-Authentication-Results: i=1; rspamd-88587c4b9-rrs48;
auth=pass smtp.auth=dreamhost smtp.mailfrom=list1@tompassin.net
X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|tpassin@tompassin.net
X-MailChannels-Auth-Id: dreamhost
X-Supply-Whistle: 3140e77a0e4271fb_1705244040229_3542645045
X-MC-Loop-Signature: 1705244040229:2103544692
X-MC-Ingress-Time: 1705244040229
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tompassin.net;
s=dreamhost; t=1705244039;
bh=yDnhf/S/sOfRo9pHgrL1vZOujaRZSf1DoOlHY/E7oZ0=;
h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding;
b=FpJ74g7wUYvyYH+NpeKaoB92DsA5+lQKTtQ5zvQXPtLBHzAMfJ17c4GaiTE9zRVA8
BDUB1CB6jyffW6N0W8inpZxTtvBmQC+Lc8w+PskJOg22IpjNPvwR4yjZj5kVZJPvBC
wyq/dWZgMVhmXfOUcPwsyCGtan22zFfj8hEc82wlPLEgb1r15KjKJMRlUAX/OPntCc
DOoVIUNzv+kgYeXjzlyu17P3PAWeYhopMo1MwmDHadpcfVojS8Pg7ScNmoL8eyu2nn
L62RQndSv6fx+k8LcCZMVFSvCBOIHSVQE8Nfi7o4dQ4aqgO/qBVhlm3ukp5pFLjBlh
u8HFlh7TmNBbw==
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <40c0fb26-6865-4a2f-8f7c-586d0ed4d23d@tompassin.net>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <bd50cbc9-48d8-4d1d-9dee-43323281ceb5@tompassin.net>
X-Mailman-Original-References: <8808f1aa-d707-44b1-98fa-36331e04a50f@web.de>
<F1CB1FD3-4F43-484A-909D-18C20EE32762@barrys-emacs.org>
<f9532b2c-dcc6-40ae-a632-b3a39b5beb69@web.de>
<65F119FD-4B27-4EB3-89FA-07B50F809596@barrys-emacs.org>
<8dcf3464-e32f-457b-8938-0ff013ed4262@web.de>
<40c0fb26-6865-4a2f-8f7c-586d0ed4d23d@tompassin.net>
 by: Thomas Passin - Sun, 14 Jan 2024 14:53 UTC

On 1/14/2024 8:54 AM, Thomas Passin via Python-list wrote:
> On 1/14/2024 7:48 AM, Sibylle Koczian via Python-list wrote:
>> Am 09.01.2024 um 12:36 schrieb Barry Scott via Python-list:
>>>
>>>
>>>> On 7 Jan 2024, at 15:09, Sibylle Koczian via Python-list
>>>> <python-list@python.org> wrote:
>>>>
>>>> Oh, and the two Windows and Python versions are on two different
>>>> computers.
>>>>
>>>> Will remove the "/env" from my shebang lines, even if I don't
>>>> understand what's happening.
>>>
>>> Thanks for the details.
>>>
>>> Only thing I can think of is that "python" may be defaulting to mean
>>> python 2.
>>> If you use "#!/usr/bin/env python3" it may work on both.
>>
>> No, it doesn't. That's the form I started with. When it didn't work I
>> thought "python3" might be too old, because Python 2 is dead for so long.
>>>
>>> Did you creates a py.ini file to configure py.exe?
>>>
>>> See if you have %userappdata%\py.ini on either windows 10 or windows 11.
>>> If so what is its contents?
>>
>> No to both.
>>>
>>> I've tried with and without a py.ini and cannot duplicate what you see.
>>>
>>
>> It really seems strange. Only thing I can think of - and I don't
>> really believe in that idea: as far as I know in Windows 11 the
>> handling of PATH has changed. My Python isn't on the path, perhaps
>> that is it. A shebang line without "/env" doesn't check the path, right?
>
> From what I've read recently, if you have a Python program that starts
> with a shebang line with any of four standard unix-like paths, then
> Python (not Windows) will look for a version of Python in standard
> locations - *NOT* in the shebang line locations:

I meant to write "the Python launcher", that is, the "py" program.
Normal Python installs on Windows install the launcher and Windows will
run it on ".py" files if no other program has been specified on the
command line.

> "To allow shebang lines in Python scripts to be portable between Unix
> and Windows, this launcher supports a number of ‘virtual’ commands to
> specify which interpreter to use. The supported virtual commands are:
>
> /usr/bin/env
> /usr/bin/python
> /usr/local/bin/python
> python
> "
>
> Also -
> "The /usr/bin/env form of shebang line has one further special property.
> Before looking for installed Python interpreters, this form will search
> the executable PATH for a Python executable matching the name provided
> as the first argument. This corresponds to the behaviour of the Unix env
> program, which performs a PATH search. If an executable matching the
> first argument after the env command cannot be found, but the argument
> starts with python, it will be handled as described for the other
> virtual commands.
> "
>
> There are some other complications, too, depending on whether you
> specify bare "python" or some specific version. The form with
> "/usr/bin/env" is the closest to the unix behavior, in that it searches
> the PATH.  And you write that your intended version of Python is not on
> the path.
>
> IOW, these shebang lines don't work the way you seem to think that they do.
>
> See https://docs.python.org/3/using/windows.html for a more complete
> rundown.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor