title: AttributeError: 'bytes' object has no attribute 'close' when Tika parser is run
body: <p>Im trying to run a simple parse line of code using Tika to parse text from a PDF (named outputFileName in this example). This used to run without errors. I recently had my laptop sent in to our work IT for software updates and had to resintall Anaconda and import certain modules (such as Tika 1.22 released on 9 Nov 2019) to run my code. I've also imported the Parser from Tika. Here is the line of code and the error message i get:</p>
  
  <p><strong>Code:</strong></p>
  
  <p><em>#parsing the text out of pdf file to work with</em></p>
  
  <p>pdftext = parser.from_file(outputFileName)</p>
  
  <p><strong>Error</strong></p>
  
  <pre><code>    AttributeError                            Traceback (most recent call last)
      &lt;ipython-input-14-239522b5ef31&gt; in &lt;module&gt;
            1 #parsing the text out of pdf file to work with
      ----&gt; 2 pdftext = parser.from_file(outputFileName)
  
      ~\AppData\Local\Continuum\anaconda3\lib\site-packages\tika\parser.py in from_file(filename, serverEndpoint, xmlContent, headers, config_path, requestOptions)
  
           34     '''
           35     if not xmlContent:
      ---&gt; 36         jsonOutput = parse1('all', filename, serverEndpoint, headers=headers,config_path=config_path, requestOptions=requestOptions)
  
           37     else:
           38         jsonOutput = parse1('all', filename, serverEndpoint, services={'meta': '/meta', 'text': '/tika', 'all': '/rmeta/xml'},
  
      ~\AppData\Local\Continuum\anaconda3\lib\site-packages\tika\tika.py in parse1(option, urlOrPath, serverEndpoint, verbose, tikaServerJar, responseMimeType, services, rawResponse, headers, config_path, requestOptions)
          327     headers.update({'Accept': responseMimeType, 'Content-Disposition': make_content_disposition_header(path)})
          328     status, response = callServer('put', serverEndpoint, service, open(path, 'rb'),
      --&gt; 329                                   headers, verbose, tikaServerJar, config_path=config_path, rawResponse=rawResponse, requestOptions=requestOptions)
          330 
          331     if file_type == 'remote': os.unlink(path)
  
      ~\AppData\Local\Continuum\anaconda3\lib\site-packages\tika\tika.py in callServer(verb, serverEndpoint, service, data, headers, verbose, tikaServerJar, httpVerbs, classpath, rawResponse, config_path, requestOptions)
          544 
          545     resp = verbFn(serviceUrl, encodedData, **effectiveRequestOptions)
      --&gt; 546     encodedData.close() # closes the file reading data
          547 
          548     if verbose:
  
      AttributeError: 'bytes' object has no attribute 'close'
  </code></pre>
  
  <p>I've also downloaded Java 8.</p>
  
  <p>Is there an issue in the tika.py source code? or have i missed somehthing in terms of what needs to be installed? Any help would be much appreciated.</p>