From 99ef42940c8f81b31eca1c4bd4904fb79dea5850 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Wed, 1 Apr 2020 16:29:18 -0700 Subject: [PATCH] docs: warn that Windows users should use an ifmain guard --- docs/api.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/api.rst b/docs/api.rst index ef429066..c38bb400 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -51,6 +51,14 @@ Forking a child process to call ``ocrmypdf.ocr()`` is suggested. That way your application will survive and remain interactive even if OCRmyPDF does not. +.. warning:: + + On Windows, the script that calls ``ocrmypdf.ocr()`` must be protected + by an "ifmain" guard (``if __name__ == '__main__'``) or you must use + ``ocrmypdf.ocr(...use_threads=True)``. If you do not take at least one + of these steps, Windows fork semantics will prevent OCRmyPDF from working + correct. + Logging -------