This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Python packaging bug? [Attn: Jason Tishler]


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]