Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unpaper PermissionError: The process cannot access the file because it is being used by another process #974

Closed
MatteoMass opened this issue May 31, 2022 · 1 comment

Comments

@MatteoMass
Copy link

MatteoMass commented May 31, 2022

Describe the bug
Can't use option deskew, clean and clean_final in the ocrmypdf.ocr() method, it returns the error in the title specifically for a temporary file called "output.pgm". This file is not used by any other process.

To Reproduce
title_in = temp_folder_image2pdf+"IMAGE_TEMP.jpg"
image = images[0]
image.save(title_in, "JPEG")
image.close()
title_out = temp_folder_image2pdf+"img2pdf.pdf"
ocrmypdf.ocr(title_in, title_out, language="ita", deskew=True, clean=True, clean_final=True, image_dpi=300)

Expected behavior
Resulting OCR of the input image

Screenshots
image

System (please complete the following information):

  • OS: Windows 10
  • Python version: 3.8.8
  • OCRmyPDF version: 13.4.3
  • Unpaper version: 6.1

Installation
OCRmyPDF was installed using pip, while Unpaper using chocolatey.

@jbarlow83
Copy link
Collaborator

After analysis it turns this is a Python issue:
https://bugs.python.org/issue35144

The solution is to upgrade to Python 3.10, the only released version with the fix available
python/cpython#24793
in addition this requires a change to ocrmypdf to take advantage of the new version.

I suspect it's actually a virus scanner process triggering this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants