[ python-Bugs-870479 ] Scripts need platform-dependent handling

SourceForge.net noreply at sourceforge.net
Sun Jan 4 14:00:26 EST 2004


Bugs item #870479, was opened at 2004-01-04 20:00
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=870479&group_id=5470

Category: Distutils
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Per Cederqvist (ceder)
Assigned to: Nobody/Anonymous (nobody)
Summary: Scripts need platform-dependent handling

Initial Comment:
When a  script is installed on Unix, it should be named
something like "mailman-discard", with no extension.
When it is installed on Windows, it should be named
"mailman-discard.py", so that it is associated with
Python.  I think that "scripts" should be smart enough
to handle this.

My suggestion is that "scripts" should be set to a list
of the scripts, including the extension, and that
distutils will remove the extension when it installs
programs on platforms where this is true:

    os.name == 'posix'

It is possible to override the install_scripts class to
get this behaviour, but if you want to make a binary
distribution you also have to override bdist_wininst,
et c, since the install_scripts class is used on the
host system while building a directory tree that will
later be installed on the target system. See this
example script:

http://cvs.lysator.liu.se/viewcvs/viewcvs.cgi/mailman-discard/setup.py?rev=1.2&cvsroot=mailman-discard&content-type=text/vnd.viewcvs-markup
 
Peter Åstrand also suggests that on Windows, you should
create a command file named "mailman-discard.cmd" and
put it in the same directory as the
"mailman-discard.py" file.  It should contain a single
line:

start %~dp0\mailman-discard.py

That way, you will be able to start the script from a
dos shell, and not just by double-clicking it in a file
browser.  It would be nice if Distutils created this
file automatically when installing on the win32 platform.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=870479&group_id=5470



More information about the Python-bugs-list mailing list