[ python-Bugs-1539295 ] Long command lines don't work on Windows

SourceForge.net noreply at sourceforge.net
Sun Aug 13 02:03:15 CEST 2006


Bugs item #1539295, was opened at 2006-08-12 21:28
Message generated for change (Comment added) made by albertstrasheim
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1539295&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Distutils
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Albert Strasheim (albertstrasheim)
Assigned to: Nobody/Anonymous (nobody)
Summary: Long command lines don't work on Windows

Initial Comment:
Windows has a 32k command line limit, described here:

http://blogs.msdn.com/oldnewthing/archive/2003/12/10/56028.aspx

The SciPy project is running into problems when using
distutils to compile LAPACK from source, because the
large number of source files results in a command line
of more than 70,000 characters.

Windows has a way of dealing with this problem, namely
putting the command line arguments in a file and
passing that file to executable with prepended with an
@, i.e. you want to run something like

lib.exe @tempdir\tempargs.lnk

SCons takes care of this through it's TEMPFILE
mechanism which uses the TempFileMunge class which can
be perused here:

http://scons.tigris.org/source/browse/scons/trunk/src/engine/SCons/Platform/__init__.py?rev=1582&view=markup

I think this problem can easily be addressed in
distutils by modifying the _spawn_nt method in spawn.py
to switch to this temp file method when the command
line length exceeds some threshold.


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

>Comment By: Albert Strasheim (albertstrasheim)
Date: 2006-08-13 02:03

Message:
Logged In: YES 
user_id=945096

Attached a first try at a patch.

Some things that could still be changed:

- We might want to print a different log info message when
using a temp file instead of calling the command directly

- Restructure the code so that the spawnv call only appears
in one place

The setup.py I attached should allow anyone to duplicate
this problem.

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

Comment By: Albert Strasheim (albertstrasheim)
Date: 2006-08-12 23:56

Message:
Logged In: YES 
user_id=945096

Okay, I'll see what I can do.

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

Comment By: Neal Norwitz (nnorwitz)
Date: 2006-08-12 23:53

Message:
Logged In: YES 
user_id=33168

Albert, could you try to work up a patch implementing this?
 It would be much more likely to get fixed that way.  It
should also work with older Windows (9x/ME).

Cheers,
n

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

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


More information about the Python-bugs-list mailing list