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

Fix config parsing for Windows #502

Merged
merged 1 commit into from
Aug 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pytesseract/pytesseract.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,9 @@ def run_tesseract(
timeout=0,
):
cmd_args = []
not_windows = not (sys.platform == 'win32')

if not sys.platform.startswith('win32') and nice != 0:
if not_windows and nice != 0:
cmd_args += ('nice', '-n', str(nice))

cmd_args += (tesseract_cmd, input_filename, output_filename_base)
Expand All @@ -249,7 +250,7 @@ def run_tesseract(
cmd_args += ('-l', lang)

if config:
cmd_args += shlex.split(config)
cmd_args += shlex.split(config, posix=not_windows)

if extension and extension not in {'box', 'osd', 'tsv', 'xml'}:
cmd_args.append(extension)
Expand Down