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 arjennienhuis
Recipients arjennienhuis, benjamin.peterson, eric.smith, loewis, vstinner
Date 2009-07-11.13:54:37
SpamBayes Score 4.32572e-05
Marked as misclassified No
Message-id <>
There are many binary formats that use ASCII numbers.

'HTTP chunking' uses ASCII mixed with binary (octets).

With 2.6 you could write:

def chunk(block):
    return b'{0:x}\r\n{1}\r\n'.format(len(block), block)

With 3.0 you'd have to write this:

def chunk(block):
    return format(len(block), 'x').encode('ascii') + b'\r\n' + block +

You cannot convert to ascii at the end of the pipeline as there are
bytes > 127 in the data blocks.
Date User Action Args
2009-07-11 13:54:40arjennienhuissetrecipients: + arjennienhuis, loewis, vstinner, eric.smith, benjamin.peterson
2009-07-11 13:54:40arjennienhuissetmessageid: <>
2009-07-11 13:54:38arjennienhuislinkissue3982 messages
2009-07-11 13:54:37arjennienhuiscreate