title: Permission error: The process cannot access the file because it is being used by another process
body: <p>I'm using windows 10, I'm using tesseract latest version for text recognition, below is the sample code I'm using now. But sometimes for some images, it gives the following.</p>
  
  <pre><code>import cv2
  import pytesseract
  pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract- 
  OCR\tesseract.exe' 
  config = ("-l eng --oem 1 --psm 7")
  </code></pre>
  
  <p><code>text=pytesseract.image_to_string(cv2.imread(r'C:\Users\Kesavan\Desktop\project\text Recogniton\opencv-text-recognition\images\cat.jpg'),config=config)</code></p>
  
  <p>print(text)</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:/Users/Kesavan/PycharmProjects/Project/text recogniton/tester.py", line 6, in &lt;module&gt;
      text=pytesseract.image_to_string(cv2.imread(r'C:\Users\Kesavan\Desktop\project\text Recogniton\opencv-text-recognition\images\cat.jpg'),config=config)
    File "C:\Users\Kesavan\PycharmProjects\learning\venv\Learnings\lib\site-packages\pytesseract\pytesseract.py", line 350, in image_to_string
      }[output_type]()
    File "C:\Users\Kesavan\PycharmProjects\learning\venv\Learnings\lib\site-packages\pytesseract\pytesseract.py", line 349, in &lt;lambda&gt;
      Output.STRING: lambda: run_and_get_output(*args),
    File "C:\Users\Kesavan\PycharmProjects\learning\venv\Learnings\lib\site-packages\pytesseract\pytesseract.py", line 265, in run_and_get_output
      return output_file.read().decode('utf-8').strip()
    File "C:\Users\Kesavan\AppData\Local\Programs\Python\Python37\lib\contextlib.py", line 119, in __exit__
      next(self.gen)
    File "C:\Users\Kesavan\PycharmProjects\learning\venv\Learnings\lib\site-packages\pytesseract\pytesseract.py", line 177, in save
      cleanup(f.name)
    File "C:\Users\Kesavan\PycharmProjects\learning\venv\Learnings\lib\site-packages\pytesseract\pytesseract.py", line 134, in cleanup
      raise e
    File "C:\Users\Kesavan\PycharmProjects\learning\venv\Learnings\lib\site-packages\pytesseract\pytesseract.py", line 131, in cleanup
      remove(filename)
  PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\Kesavan\\AppData\\Local\\Temp\\tess_jjp7wfoq.txt'
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/5DfbJ.jpg" rel="nofollow noreferrer">This is the image for which I'm facing the issue</a></p>
  
  <p>Thanks in advance </p>