This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author erik.bray
Recipients erik.bray, masamoto, zach.ware
Date 2016-10-14.13:34:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1476452085.73.0.180033377767.issue28441@psf.upfronthosting.co.za>
In-reply-to
Content
This actually came up previously in #1543469 in the context of test_subprocess, but it's a more general issue that I thought was worth addressing somehow.

The issue here is that as Cygwin tries to provide a "UNIX-like" experience, any system interfaces that take the path to an executable as an argument allow the .exe extension to be left off.  This is particularly convenient for the shell experience, so that one can run, for example "python" or "ls" without typing "python.exe"  or "ls.exe" (this is of course true of the Windows cmd shell as well).

In the case of ambiguity however--such as when there is both a "python" and a "python.exe" in the same path, one must explicitly add the ".exe", otherwise the path without the exe is assumed.  This is made even worse when you factor in case-insensitivity.

Thus, this becomes a real annoyance when developing Python on Cygwin because you get both a "python.exe" and the "Python" directory in your source tree.  This isn't so much of a problem, except that sys.executable leaves off the ".exe" (in UNIX-y fashion), so any test that calls Popen([sys.executable]) errors out because it thinks you're trying to execute a directory (Python/).

I think the only reasonable fix is to take the patch suggested at #1543469, and ensure that the ".exe" suffix is appended to sys.executable on Cygwin.  I think that sys.executable should be as unambiguous as possible, and that's the only way to make it reasonably unambiguous on Cygwin.

I've attached a patch adapted from the one in #1543469 which solves the issue for me.
History
Date User Action Args
2016-10-14 13:34:46erik.braysetrecipients: + erik.bray, zach.ware, masamoto
2016-10-14 13:34:45erik.braysetmessageid: <1476452085.73.0.180033377767.issue28441@psf.upfronthosting.co.za>
2016-10-14 13:34:45erik.braylinkissue28441 messages
2016-10-14 13:34:44erik.braycreate