Author christian.heimes
Recipients amaury.forgeotdarc, christian.heimes, gvanrossum
Date 2007-11-13.16:35:22
SpamBayes Score 0.0516556
Marked as misclassified No
Message-id <1194971722.78.0.382878292531.issue1415@psf.upfronthosting.co.za>
In-reply-to
Content
As far as I can see print() works if sys.stdout is either None (discard
output ASAP) or a file like object. Even print(file=syst.stderr) works.

sys.stdout.write() is going to fail when sys.stdout is None but that's
not my concern. It's another well documented difference between Python
2.x and 3.x. If people still need a valid but no op stdout they can set
up their own:

class NullWriter:
    def write(self, data):
        pass

if sys.stdout is None:
    sys.stdout = NullWriter()

Done ;)
History
Date User Action Args
2007-11-13 16:35:23christian.heimessetspambayes_score: 0.0516556 -> 0.0516556
recipients: + christian.heimes, gvanrossum, amaury.forgeotdarc
2007-11-13 16:35:23christian.heimessetspambayes_score: 0.0516556 -> 0.0516556
messageid: <1194971722.78.0.382878292531.issue1415@psf.upfronthosting.co.za>
2007-11-13 16:35:22christian.heimeslinkissue1415 messages
2007-11-13 16:35:22christian.heimescreate