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.

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 <>
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):

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

Done ;)
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: <>
2007-11-13 16:35:22christian.heimeslinkissue1415 messages
2007-11-13 16:35:22christian.heimescreate