title: TypeError with HTML escaping in python3
body: <p>I try to html escape a string</p>
  
  <pre><code>from html import escape
  project_name_unescaped = Project.get('name').encode('utf-8')
  project_name = escape(project_name_unescaped)
  </code></pre>
  
  <p>I get the following error</p>
  
  <pre><code>Traceback (most recent call last):
    File "hosts.py", line 70, in &lt;module&gt;
       project_name = escape(bytes(project_name_unescaped))
    File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/html/__init__.py", line 19, in escape
      s = s.replace("&amp;", "&amp;amp;") # Must be done first!
   TypeError: a bytes-like object is required, not 'str'
  </code></pre>
  
  <p>I also tried it with the following, but still have the same error</p>
  
  <pre><code>project_name = escape(bytes(project_name_unescaped))
  </code></pre>
  
  <p>The strange thing is, I'm pretty sure this had worked before. Any ideas whats wrong or what I need to change to make it work again? Also I tried it before with </p>
  
  <pre><code>from cgi import escape
  </code></pre>