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 serhiy.storchaka
Recipients Guillaume Aldebert, paul.moore, serhiy.storchaka, steve.dower, tim.golden, vstinner, zach.ware
Date 2017-11-07.13:04:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1510059896.19.0.213398074469.issue31966@psf.upfronthosting.co.za>
In-reply-to
Content
I don't know which part of _WindowsConsoleIO.write() fails to handle empty bytes string, but the simplest and the most efficient way to fix this bug it to add an explicit check for zero length at the begin of this method and return Python integer 0 in this case.

The test should check that sys.stdout.buffer.write(b''), sys.stdout.buffer.write(b'') and sys.stdout.buffer.raw.write(b'') return 0 (the latter to checks should be performed only if the corresponding buffer and raw attributes exist). There are special tests for WindowsConsoleIO, it would be nice to add an explicit test here too.
History
Date User Action Args
2017-11-07 13:04:56serhiy.storchakasetrecipients: + serhiy.storchaka, paul.moore, vstinner, tim.golden, zach.ware, steve.dower, Guillaume Aldebert
2017-11-07 13:04:56serhiy.storchakasetmessageid: <1510059896.19.0.213398074469.issue31966@psf.upfronthosting.co.za>
2017-11-07 13:04:56serhiy.storchakalinkissue31966 messages
2017-11-07 13:04:56serhiy.storchakacreate