title: Encode string representation of integer to base64 in Python 3
body: <p>I'm trying to encode an int in to base64, i'm doing that:</p>
  
  <pre><code>foo = 1
  base64.b64encode(bytes(foo))
  </code></pre>
  
  <p><strong>expected output:</strong> <code>'MQ=='</code></p>
  
  <p><strong>given output:</strong> <code>b'AA=='</code></p>
  
  <p>what i'm doing wrong?</p>
  
  <p>Edit: in Python 2.7.2 works correctly</p>