[Python-checkins] python/nondist/sandbox/setuptools EasyInstall.txt, 1.63, 1.64 launcher.c, 1.2, 1.3

pje@users.sourceforge.net pje at users.sourceforge.net
Sun Oct 16 22:45:34 CEST 2005


Update of /cvsroot/python/python/nondist/sandbox/setuptools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19978

Modified Files:
	EasyInstall.txt launcher.c 
Log Message:
Fix problem with Windows console scripts conflicting with module names,
thereby confusing the import process.  Scripts are now generated with a
suffix of the form '-script.py' to avoid conflicts.  (The .exe's are still
generated without the '-script' part, so you don't have to type it.)
Thanks to Matthew R. Scott for reporting the problem.


Index: EasyInstall.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/EasyInstall.txt,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- EasyInstall.txt	16 Oct 2005 17:42:11 -0000	1.63
+++ EasyInstall.txt	16 Oct 2005 20:45:28 -0000	1.64
@@ -780,6 +780,9 @@
 0.6a6
  * Added ``--no-deps`` option.
 
+ * Improved Windows ``.exe`` script wrappers so that the script can have the
+   same name as a module without confusing Python.
+
 0.6a3
  * Improved error message when trying to use old ways of running
    ``easy_install``.  Removed the ability to run via ``python -m`` or by

Index: launcher.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/launcher.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- launcher.c	24 Sep 2005 20:29:57 -0000	1.2
+++ launcher.c	16 Oct 2005 20:45:29 -0000	1.3
@@ -12,8 +12,8 @@
 
     To build/rebuild with mingw32, do this in the setuptools project directory:
 
-        gcc -DGUI=0           -mno-cygwin -O -s -o setuptools/cli.exe launcher.c
-        gcc -DGUI=1 -mwindows -mno-cygwin -O -s -o setuptools/gui.exe launcher.c
+       gcc -DGUI=0           -mno-cygwin -O -s -o setuptools/cli.exe launcher.c
+       gcc -DGUI=1 -mwindows -mno-cygwin -O -s -o setuptools/gui.exe launcher.c
 
     It links to msvcrt.dll, but this shouldn't be a problem since it doesn't
     actually run Python in the same process.  Note that using 'exec' instead
@@ -55,7 +55,8 @@
     end = script + strlen(script);
     while( end>script && *end != '.')
         *end-- = '\0';
-    strcat(script, (GUI ? "pyw" : "py"));
+    *end-- = '\0';
+    strcat(script, (GUI ? "-script.pyw" : "-script.py"));
 
     /* figure out the target python executable */
 
@@ -74,7 +75,6 @@
 
     *ptr = '\0';
     while (ptr>python && isspace(*ptr)) *ptr-- = '\0';  /* strip trailing sp */
-
     if (strncmp(python, "#!", 2)) {
         /* default to python.exe if no #! header */
         strcpy(python, "#!python.exe");



More information about the Python-checkins mailing list