title: file() in python 2 cannot be replaced with open() in python 3 for pdfminer
body: <p>I am trying to get xml file of all my pdfs in the path, and for that I want to use pdfminer code from <a href="https://github.com/euske/pdfminer/blob/master/tools/pdf2txt.py" rel="nofollow noreferrer">https://github.com/euske/pdfminer/blob/master/tools/pdf2txt.py</a> on python 3. I installed pdfminer.six and all the related packages as well. However there is one problem with opening the files with file('', 'rb'), which should be replaced with open ('', 'rb'). But the output that I get from open () is not the same with file (), therefore the function written on github link is not running my pdf files.  </p>
  
  <p>For instance,</p>
  
  <p>in python 2, the following code returns;</p>
  
  <pre class="lang-py prettyprint-override"><code>fp = file(filepath, 'rb') 
  
  &lt;open file '...\\lehsfil2.pdf', mode 'rb' at 0x04ADB180&gt;
  </code></pre>
  
  <p>whereas the correspondence of file() function in python 3 returns;</p>
  
  <pre class="lang-py prettyprint-override"><code>fp = open(filepath, 'rb') 
  
  &lt;_io.BufferedReader name='...\\lehsfil2.pdf'&gt;
  </code></pre>
  
  <p>Is there a direct correspondence of file() in python2, to python3, which returns the same object?</p>