[Patches] [ python-Patches-409444 ] Redirect stdout in distutils.spawn
noreply@sourceforge.net
noreply@sourceforge.net
Thu, 16 Aug 2001 06:50:34 -0700
Patches item #409444, was opened at 2001-03-17 12:36
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=409444&group_id=5470
Category: distutils
Group: None
>Status: Closed
>Resolution: Rejected
Priority: 5
Submitted By: A.M. Kuchling (akuchling)
Assigned to: A.M. Kuchling (akuchling)
Summary: Redirect stdout in distutils.spawn
Initial Comment:
The attached patch (yeah, right) modifies
distutils/spawn.py to add the ability
to redirect standard output to a file, at least
on POSIX platforms. This would be needed for Barry's
patch to support shar as a Distutils output format.
Questions:
* Is this a good idea?
* Is the interface right? Should it take a
file object instead of a filename? (It therefore
always uses 'wb' mode, which may be bad.)
* Can someone contribute the required changes to
make this work on NT?
----------------------------------------------------------------------
>Comment By: A.M. Kuchling (akuchling)
Date: 2001-08-16 06:50
Message:
Logged In: YES
user_id=11375
Agreed. Marking as rejected.
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2001-08-16 04:20
Message:
Logged In: YES
user_id=21627
I recommend to reject this patch. Apparently, still nobody
has contributed code to support this on NT; I believe you'd
need to use CreateProcess(Ex?) to make it work, which is not
exposed anywhere in standard Python.
Furthermore, I don't like the posix approach, either. There
is no guarantee that the next open will assign fd 1 again.
If the assertion fails, I bet that spawn() will not raise a
Distutils error, as it should. Instead, funny things may
happen due to the AssertionError being raised.
Instead, the right way probably is to use
os.open/os.dup2/os.fdopen.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=409444&group_id=5470