title: TypeError: a bytes-like object is required, not 'str' python3
body: <p>In my project, I'm dynamically writing styles into HTML file. I have recently migrated from python2 to 3. Now it's throwing an error as shown below log:</p>
  
  <p>Code Snippet :</p>
  
  <pre><code> html_text = markdown(html_content, output_format='html4')
      css = const.URL_SCHEME + "://" + request_host + '/static/css/pdf.css'
      css = css.replace('\\', "/")
      # HTML File Output
      #print 'Started Html file generated' + const.CRUMBS_TIMESTAMP
      html_file = open(os.getcwd() + const.MEDIA_UPLOADS + uploaded_file_name + '/output/' +
                       uploaded_file + '.html', "wb")
      #print(html_file)
      html_file.write('&lt;style&gt;')
      html_file.write(urllib.request.urlopen(css).read())
      html_file.write('&lt;/style&gt;')
  </code></pre>
  
  <p>Error Log :</p>
  
  <pre><code>Quit the server with CTRL-BREAK.
  ('Unexpected error:', &lt;class 'TypeError'&gt;)
  Traceback (most recent call last):
    File "C:\Dev\EXE\crumbs_alteryx\alteryx\views.py", line 937, in parser
      result_upload['filename'])
    File "C:\Dev\EXE\crumbs_alteryx\alteryx\views.py", line 767, in generate_html
      html_file.write('&lt;style&gt;')
  TypeError: a bytes-like object is required, not 'str'
  </code></pre>