Message90421
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 +
b'\r\n'
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:40 | arjennienhuis | set | recipients:
+ arjennienhuis, loewis, vstinner, eric.smith, benjamin.peterson |
2009-07-11 13:54:40 | arjennienhuis | set | messageid: <1247320480.38.0.277534478263.issue3982@psf.upfronthosting.co.za> |
2009-07-11 13:54:38 | arjennienhuis | link | issue3982 messages |
2009-07-11 13:54:37 | arjennienhuis | create | |
|