Enforce str-only environment for Windows since it's more strict
This commit is contained in:
@@ -205,6 +205,8 @@ def run_ocrmypdf_api(input_file, output_file, *args, env=None):
|
||||
if env:
|
||||
options.tesseract_env = env
|
||||
options.tesseract_env['_OCRMYPDF_TEST_INFILE'] = os.fspath(input_file)
|
||||
if options.tesseract_env:
|
||||
assert all(isinstance(v, (str, bytes)) for v in options.tesseract_env.values())
|
||||
|
||||
return api.run_pipeline(options, api=False)
|
||||
|
||||
|
||||
+1
-1
@@ -303,7 +303,7 @@ def test_maximum_options(
|
||||
|
||||
def test_tesseract_missing_tessdata(resources, no_outpdf, tmpdir):
|
||||
env = os.environ.copy()
|
||||
env['TESSDATA_PREFIX'] = tmpdir
|
||||
env['TESSDATA_PREFIX'] = os.fspath(tmpdir)
|
||||
|
||||
returncode = run_ocrmypdf_api(
|
||||
resources / 'graph.pdf', no_outpdf, '-v', '1', '--skip-text', env=env
|
||||
|
||||
Reference in New Issue
Block a user