title: Python: concatenating bytes with a string
body: <p>I'm working on a python project in 2.6 that also has future support for python 3 being worked in.  Specifically I'm working on a digest-md5 algorithm.  </p>
  
  <p>In python 2.6 without running this import:  </p>
  
  <pre><code>from __future__ import unicode_literals
  </code></pre>
  
  <p>I am able to write a piece of code such as this:</p>
  
  <pre><code>a1 = hashlib.md5("%s:%s:%s" % (self.username, self.domain, self.password)).digest() 
  a1 = "%s:%s:%s" %(a1, challenge["nonce"], cnonce )
  </code></pre>
  
  <p>Without any issues, my authentication works fine.  When I try the same line of code with the unicode_literals imported I get an exception:  </p>
  
  <p>UnicodeDecodeError: 'utf8' codec can't decode byte 0xa8 in position 0: unexpected code byte </p>
  
  <p>Now I'm relatively new to python so I'm a bit stuck in figuring this out.  if I replace the %s in the formatting string as %r I am able to concatenate the string, but the authentication doesn't work.  The digest-md5 spec that I had read says that the 16 octet binary digest must be appended to these other strings.</p>
  
  <p>Any thoughts?</p>