This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Redirect stdout in distutils.spawn
Type: Stage:
Components: Distutils Versions:
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, loewis
Priority: normal Keywords: patch

Created on 2001-03-17 20:36 by akuchling, last changed 2022-04-10 16:03 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
diff akuchling, 2001-03-17 20:36 Patch to redirect stdout in distutils.spawn
Messages (3)
msg36109 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2001-03-17 20:36
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?

msg36110 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2001-08-16 11:20
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.
msg36111 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2001-08-16 13:50
Logged In: YES 
user_id=11375

Agreed.  Marking as rejected.
History
Date User Action Args
2022-04-10 16:03:52adminsetgithub: 34182
2001-03-17 20:36:27akuchlingcreate