On Mon, Jan 3, 2011 at 5:29 PM, P.J. Eby <p...@telecommunity.com> wrote:
> At 08:04 PM 1/3/2011 -0500, Randy Syring wrote:
>>
>> In the server/gateway example, there is a comment in the code that says:
>>
>> # TODO: this needs to be binary on Py3
>>
>> The "TODO" part confuses me.  In other areas of the PEP, there are
>> comments like:
>>
>> # call must be byte-safe on Py3
>>
>> which make sense.  But is the TODO meant to be a TODO for the PEP or is it
>> meant to be a note to the person running the example on Py3.  If the latter,
>> maybe "TODO" isn't the best prefix.
>>
>> FWIW, don't consider this an objection, it is just a question I had as I
>> read through the PEP.
>
> Those are my TODO's for the PEP itself, and I've fixed a couple of them in
> SVN (probably around the time you were writing the above).  If somebody can
> point me to the proper Py3 incantation for writing bytes to stdout, I'll fix
> the one remaining TODO marker as well.

Would

  sys.stdout.buffer.write(b'abc')

do?

(If you mix this with writing strings to sys.stdout directly, you may
have to call sys.stdout.flush() first.)

-- 
--Guido van Rossum (python.org/~guido)
_______________________________________________
Web-SIG mailing list
Web-SIG@python.org
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: 
http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com

Reply via email to