From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:102]) by sourceware.org (Postfix) with ESMTPS id CE94539AF1B7 for ; Wed, 3 Feb 2021 15:35:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CE94539AF1B7 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=anrdaemon@yandex.ru Received: from sas1-934f36a1872d.qloud-c.yandex.net (sas1-934f36a1872d.qloud-c.yandex.net [IPv6:2a02:6b8:c14:492:0:640:934f:36a1]) by forward102p.mail.yandex.net (Yandex) with ESMTP id 4675A1D41EF0; Wed, 3 Feb 2021 18:35:02 +0300 (MSK) Received: from sas1-27140bb19246.qloud-c.yandex.net (sas1-27140bb19246.qloud-c.yandex.net [2a02:6b8:c08:1803:0:640:2714:bb1]) by sas1-934f36a1872d.qloud-c.yandex.net (mxback/Yandex) with ESMTP id mSYZETAe6i-Z2JWOcKs; Wed, 03 Feb 2021 18:35:02 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1612366502; bh=6gvwCkAyI/i1ZzeSbgs0rnfoY9FPfsx7K90/IK6OHpM=; h=In-Reply-To:Subject:To:From:Message-ID:References:Date:Reply-To; b=Ou4/xKKyaWwbNtq+y+BxaPKlkcPJeUpNdUgO5QXLaRhCpx1ZsavoxldIewr6hqoSe bKrh+vaUGhafJVOhwAdB3LnBKwrd7eZ1vTAYWqjQyXmoEORhsJ9018QMzYEpKIzlIa Db41d9wc0/+/4yBXxyK4hjUSUEZiBDlg5bEAOCYg= Authentication-Results: sas1-934f36a1872d.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru Received: by sas1-27140bb19246.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id QXtQfbSCt7-Z1JCxdLv; Wed, 03 Feb 2021 18:35:01 +0300 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client certificate not present) Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Wed, 03 Feb 2021 15:27:48 -0000 Date: Wed, 3 Feb 2021 18:27:48 +0300 From: Andrey Repin X-Mailer: The Bat! (v6.8.8) Home Reply-To: cygwin@cygwin.com X-Priority: 3 (Normal) Message-ID: <399245376.20210203182748@yandex.ru> To: "Lemke, Michael SF/HZA-ZIC2" , cygwin@cygwin.com Subject: Re: python sys.executable inconsistency if called from cmd In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_THEBAT, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2021 15:35:13 -0000 Greetings, Lemke, Michael SF/HZA-ZIC2! > I don't know anything about python but want to use cygwin's > python from nodejs with npm-gyp. The npm-gyp module is trying to > find the python executable path from sys.executable and fails. If that's true, then it should be fixed upstream. > While investigating this I found this to me quite inconsistent > behavior: > cygwin> /bin/python3.6m.exe -c 'import sys; print(sys.executable);' > /bin/python3.6m > cygwin> python3.6m -c 'import sys; print(sys.executable);' > /usr/bin/python3.6m > cygwin> python3.6 -c 'import sys; print(sys.executable);' > /usr/bin/python3.6 > cygwin> python3.6m.exe -c 'import sys; print(sys.executable);' > /usr/bin/python3.6m > cmd> c:/MyStuff/NCygwin64/bin/python3.6m.exe -c 'import sys; print(sys.executable);' > /usr/bin/python3.6m > cmd> rem add cygwin path to Windows: > cmd> path %PATH%;c:\MYSTUFF\ncygwin64\bin > cmd> python3.6m.exe -c 'import sys; print(sys.executable);' > /c/MYSTUFF/ncygwin64/bin/python3.6m > With CMD I'll never get an executable that actually works from cmd. > Is this expected? Yes. This is Cygwin, not Windows CMD. > Is there a way around to make this work? Yes, write scripts correctly, correctly translate paths. See: > FAQ: https://cygwin.com/faq/ > Documentation: https://cygwin.com/docs.html Specifically see `man cygpath`. -- With best regards, Andrey Repin Wednesday, February 3, 2021 18:25:18 Sorry for my terrible english...