title: Byte formatting in python 3
body: <p>I know this question has been asked before, but couldn't get it working for me though.
  What I want to do is sent a prefix with my message like so:</p>
  
  <pre><code>msg = pickle.dumps(message)
  prefix = b'{:0&gt;5d}'.format(len(msg))
  message = prefix + msg
  </code></pre>
  
  <p>This gives me</p>
  
  <pre><code>AttributeError: 'bytes' object has no attribute 'format'
  </code></pre>
  
  <p>I tried formatting with <code>%</code> and encoding but none of them worked.</p>