[issue3982] support .format for bytes

Arjen Nienhuis report at bugs.python.org
Mon Mar 7 13:34:56 CET 2011


Arjen Nienhuis <a.g.nienhuis at gmail.com> added the comment:

struct.pack does not work with variable length data. Something like:

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

or

b'%x\r\n%s\r\n' % (len(block), block)

is not possible with struct.pack

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3982>
_______________________________________


More information about the Python-bugs-list mailing list