Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Fri, 23 Jan 2004 11:10:49 -0500 From: Jason Tishler To: cygwin AT cygwin DOT com Subject: Re: Python packaging bug? [Attn: Jason Tishler] Message-ID: <20040123161048.GM1920@tishler.net> Mail-Followup-To: cygwin AT cygwin DOT com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-IsSubscribed: yes Igor, On Fri, Jan 23, 2004 at 09:27:53AM -0500, Igor Pechtchanski wrote: > I'm not sure if this is a bug (hence the question mark in the subject), > but the two python scripts in /usr/bin ("idle" and "pydoc") refer to > /usr/bin/python.exe in their #! line. Is there a particular reason why > they don't just use /usr/bin/python? I know it makes no difference in > Cygwin, but it might be confusing. The above is by design: def copy_scripts (self): """Copy each script listed in 'self.scripts'; if it's marked as a Python script in the Unix way (first line matches 'first_line_re', ie. starts with "\#!" and contains "python"), then adjust the first line to refer to the current Python interpreter as we copy. """ [snip] if adjust: log.info("copying and adjusting %s -> %s", script, self.build_dir) [snip] else: outf.write("#!%s%s\n" % (os.path.join( sysconfig.get_config_var("BINDIR"), "python" + sysconfig.get_config_var("EXE")), post_interp)) Note the reference to EXE above. > Also, I looked at the Python sources, and the sample scripts there > contain '#! /usr/bin/env python' (not /usr/bin/python.exe). I'm > guessing that this somehow gets changed in setup.py, but don't know > enough Python to find exactly where this happens. This "problem" has > been present since at least python-2.3-2 (maybe earlier). Python uses the following: #! /usr/bin/env python as its standard trigger line. In this way, scripts will use the version of python found on the user's PATH first. Some like this approach, some don't. Do we have too much time on our hands? :,) Jason -- PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6 -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/