ocrmypdf/OCRmyPDF · warning · DeprecationWarning
semfree.py is deprecated and will be removed in a future rel
Error message
semfree.py is deprecated and will be removed in a future release.
What it means
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.
Source
Thrown at src/ocrmypdf/extra_plugins/semfree.py:39
from __future__ import annotations
import logging
import logging.handlers
import signal
import warnings
from collections.abc import Callable, Iterable, Iterator
from contextlib import suppress
from enum import Enum, auto
from itertools import islice, repeat, takewhile, zip_longest
from multiprocessing import Pipe, Process
from multiprocessing.connection import Connection, wait
from ocrmypdf import Executor, hookimpl
from ocrmypdf._concurrent import NullProgressBar
from ocrmypdf.exceptions import InputFileError
from ocrmypdf.helpers import remove_all_log_handlers
warnings.warn(
"semfree.py is deprecated and will be removed in a future release.",
DeprecationWarning,
)
class MessageType(Enum):
"""Implement basic IPC messaging."""
exception = auto() # pylint: disable=invalid-name
result = auto() # pylint: disable=invalid-name
complete = auto() # pylint: disable=invalid-name
def split_every(n: int, iterable: Iterable) -> Iterator:
"""Split iterable into groups of n.
>>> list(split_every(4, range(10)))
[[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]]View on GitHub (pinned to 5074a0b0e1)
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')
Example fix
# before
ocrmypdf.ocr('in.pdf','out.pdf', plugins=['ocrmypdf.extra_plugins.semfree'])
# after
ocrmypdf.ocr('in.pdf','out.pdf') # once migrated off semfree Defensive patterns
Strategy: validation
Validate before calling
import importlib.util\nif importlib.util.find_spec('ocrmypdf.extra_plugins.semfree'):\n plan_migration() Try / catch
with warnings.catch_warnings():\n warnings.simplefilter('ignore', DeprecationWarning)\n import ocrmypdf.extra_plugins.semfree Prevention
- Track OCRmyPDF release notes for plugin removals
- Audit plugin lists in configs each upgrade
When it happens
Trigger: import ocrmypdf.extra_plugins.semfree or listing it in the plugins= argument to ocrmypdf.ocr().
Common situations: Users of the semaphore-free concurrent execution plugin upgrading OCRmyPDF; plugin lists persisted in config/scripts.
Related errors
- A worker process lost access to an input file
- ocrmypdf.ocr(jpg_quality=...) is deprecated, use jpeg_qualit
- ocrmypdf.ocr(verbose=) is ignored. Use ocrmypdf.configure_lo
- jbig2_lossy is deprecated and will be ignored. Lossy JBIG2 h
- jbig2_page_group_size is deprecated and will be ignored.
AI-assisted analysis of ocrmypdf/OCRmyPDF@5074a0b0e1 (2026-08-27).
Data as JSON: /api/errors/68da06a236c7f71a.
Report an issue: GitHub.