{"record":{"id":"68da06a236c7f71a","repo":"ocrmypdf/OCRmyPDF","slug":"semfree-py-is-deprecated-and-will-be-removed-in-a","errorCode":null,"errorMessage":"semfree.py is deprecated and will be removed in a future release.","messagePattern":"semfree\\.py is deprecated and will be removed in a future release\\.","errorType":"console","errorClass":"DeprecationWarning","httpStatus":null,"severity":"warning","filePath":"src/ocrmypdf/extra_plugins/semfree.py","lineNumber":39,"sourceCode":"from __future__ import annotations\n\nimport logging\nimport logging.handlers\nimport signal\nimport warnings\nfrom collections.abc import Callable, Iterable, Iterator\nfrom contextlib import suppress\nfrom enum import Enum, auto\nfrom itertools import islice, repeat, takewhile, zip_longest\nfrom multiprocessing import Pipe, Process\nfrom multiprocessing.connection import Connection, wait\n\nfrom ocrmypdf import Executor, hookimpl\nfrom ocrmypdf._concurrent import NullProgressBar\nfrom ocrmypdf.exceptions import InputFileError\nfrom ocrmypdf.helpers import remove_all_log_handlers\n\nwarnings.warn(\n    \"semfree.py is deprecated and will be removed in a future release.\",\n    DeprecationWarning,\n)\n\n\nclass MessageType(Enum):\n    \"\"\"Implement basic IPC messaging.\"\"\"\n\n    exception = auto()  # pylint: disable=invalid-name\n    result = auto()  # pylint: disable=invalid-name\n    complete = auto()  # pylint: disable=invalid-name\n\n\ndef split_every(n: int, iterable: Iterable) -> Iterator:\n    \"\"\"Split iterable into groups of n.\n\n    >>> list(split_every(4, range(10)))\n    [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]]","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/ocrmypdf/OCRmyPDF/blob/5074a0b0e109362422b768fd271ed84bf717c4ec/src/ocrmypdf/extra_plugins/semfree.py#L21-L57","documentation":"Module-level DeprecationWarning fired on importing ocrmypdf.extra_plugins.semfree: the semfree plugin will be removed in a future release. Importing it still works for now.","triggerScenarios":"import ocrmypdf.extra_plugins.semfree or listing it in the plugins= argument to ocrmypdf.ocr().","commonSituations":"Users of the semaphore-free concurrent execution plugin upgrading OCRmyPDF; plugin lists persisted in config/scripts.","solutions":["Plan migration off semfree before upgrading to the release that removes it","Check release notes for a replacement concurrency plugin or built-in behavior","Silence temporarily with warnings.filterwarnings('ignore', category=DeprecationWarning, module='.*semfree')"],"exampleFix":"# before\nocrmypdf.ocr('in.pdf','out.pdf', plugins=['ocrmypdf.extra_plugins.semfree'])\n# after\nocrmypdf.ocr('in.pdf','out.pdf')  # once migrated off semfree","handlingStrategy":"validation","validationCode":"import importlib.util\\nif importlib.util.find_spec('ocrmypdf.extra_plugins.semfree'):\\n    plan_migration()","typeGuard":null,"tryCatchPattern":"with warnings.catch_warnings():\\n    warnings.simplefilter('ignore', DeprecationWarning)\\n    import ocrmypdf.extra_plugins.semfree","preventionTips":["Track OCRmyPDF release notes for plugin removals","Audit plugin lists in configs each upgrade"],"tags":["deprecation","plugin","semfree","removal"],"backgroundTag":"deprecated-module-import","analyzedSha":"5074a0b0e109362422b768fd271ed84bf717c4ec","analyzedAt":"2026-08-27T11:57:38.523Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}