Skip to content

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

Closed

Description

@MatteoMass

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.

Activity

  1. jbarlow83 commented on Jun 2, 2022

    @jbarlow83
    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.

  2. added a commit that references this issue on Jan 26, 2024
    10c703e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions