title: base64 Type Err, TypeError: expected bytes, not str
body: <p>when I try this code:</p>
  
  <pre><code>#!/usr/bin/python3.2
  
  import time, sys, os
  import base64
  #####################
  tmp = "/home/gh.txt"
  ex = "/home/ex.txt"
  if (len(sys.argv) &lt; 2):
      print("enter name of the new dict and key")
  else:
      global ns
      ns = sys.argv[1]
      global ps
      ps = sys.argv[2]
  
  dss = "{&lt;%s&gt;:%s}" % (ns, ps)
  os.system("touch dss0")
  fi0 = open(tmp, "a")
  
  fi0.write(dss)
  d64i = base64.b64encode(tmp)
  fi = open(ex, "a")
  fi.write(d64i)
  os.system("rm tmp")
  </code></pre>
  
  <p>I got this is error:</p>
  
  <pre><code>File "./n64.py", line 19, in &lt;module&gt;
       d64i=base64.b64encode("/home/gh.txt")
  File "/usr/lib/python3.2/base64.py", line 56, in b64encode
       raise TypeError("expected bytes, not %s" % s.__class__.__name__)
  TypeError: expected bytes, not str
  </code></pre>