title: expected str, bytes or os.PathLike object, not pisaContext
body: <p>I'm trying to send PDF via email:</p>
  
  <pre><code>def render_to_pdf(template_src, context_dict={}):
      template = get_template(template_src)
      html = template.render(context_dict)
      result = BytesIO()
      pdf = pisa.pisaDocument(BytesIO(html.encode("ISO-8859-1")), result)
      if not pdf.err:
          return pdf
      return None
  </code></pre>
  
  <p>in my <strong>views</strong>:</p>
  
  <pre><code>pdf = render_to_pdf('expenses/pdf_report.html', data)
  mail.attach_file(pdf)
  mail.send()
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>expected str, bytes or os.PathLike object, not pisaContext</p>
  </blockquote>
  
  <p>How can I get str or bytes instead of <code>pisaContext</code>?</p>