title: TypeError: expected bytes, str found in custom python function
body: <p>I am using a new bioinformatics tool called Giggle and I have installed the python wrapper on my system.
  Even though the scenario is quite specific, I think the problem is quite general.
  This function: </p>
  
  <pre><code>index = Giggle.create("index", "HMEC_hg19_BroadHMM_ALL.bed")
  </code></pre>
  
  <p>should create an index based on several (or in this case one) .bed file.
  The bed files look like this: </p>
  
  <pre><code>chr1    10000   10600   15_Repetitive/CNV   0   .   10000   10600   245,245,245
  chr1    10600   11137   13_Heterochrom/lo   0   .   10600   11137   245,245,245
  chr1    11137   11737   8_Insulator 0   .   11137   11737   10,190,254
  chr1    11737   11937   11_Weak_Txn 0   .   11737   11937   153,255,102
  chr1    11937   12137   7_Weak_Enhancer 0   .   11937   12137   255,252,4
  chr1    12137   14537   11_Weak_Txn 0   .   12137   14537   153,255,102
  chr1    14537   20337   10_Txn_Elongation   0   .   14537   20337   0,176,80
  </code></pre>
  
  <p>It is basically a large tab delimited file containing genomic intervals and their corresponding chromosome. When running the above command I get the following error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "giggle/giggle.pyx", line 25, in giggle.giggle.Giggle.create
  TypeError: expected bytes, str found
  </code></pre>
  
  <p>I have no clue why this is happening and I have tried converting the files to other types of encoding but nothing worked. The code snippet to which the error refers is as follows:</p>
  
  <pre><code>def create(self, char *path, char *glob):
      giggle_bulk_insert(to_bytes(glob), to_bytes(path), 1)
      return Giggle(path)
  </code></pre>
  
  <p>I am using Python 3.6 on a Linux subsystem for windows 10. </p>