Author akira
Recipients Arfrever, akira, docs@python, eryksun, martin.panter, r.david.murray, rbcollins, snaphat, steve.dower, tim.golden, zach.ware
Date 2014-12-25.06:02:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1419487361.68.0.683851761394.issue22673@psf.upfronthosting.co.za>
In-reply-to
Content
Two minor details:

1. It is possible that `fileno(stdout) != 1` even in C [1]. 
   I don't know what happens if the code from the answer is
   run on Windows.

   In principle, it may break eryksun's workaround. I don't 
   know how likely it is in practice.

2. you can redirect at the file descriptor level in Python [2] 
   using os.dup2(). I don't know whether the code in the 
   answer works on Windows.

[1] http://stackoverflow.com/questions/25516375/is-it-possible-that-filenostdout-1-on-a-posix-system
[2] http://stackoverflow.com/questions/4675728/redirect-stdout-to-a-file-in-python/22434262#22434262
History
Date User Action Args
2014-12-25 06:02:41akirasetrecipients: + akira, rbcollins, tim.golden, Arfrever, r.david.murray, docs@python, martin.panter, zach.ware, eryksun, steve.dower, snaphat
2014-12-25 06:02:41akirasetmessageid: <1419487361.68.0.683851761394.issue22673@psf.upfronthosting.co.za>
2014-12-25 06:02:41akiralinkissue22673 messages
2014-12-25 06:02:40akiracreate