--- Begin Message ---
Source: ocrmypdf
Version: 6.2.2-1
User: [email protected]
Usertags: regression
Dear Sean,
With the upload of version 6.2.2-1 your package started to fail its
autopgktest in testing, however it passes in unstable. I copied the
output below.
Could you please investigate? I noticed in the changelog/BTS that you
need python3-ruffus 2.7 but I don't see that in the (build-)
dependencies, did you loosen it too much? Currently this regression is
delaying the migration to testing by 13 days.
Paul
https://ci.debian.net/data/autopkgtest/testing/amd64/o/ocrmypdf/607994/log.gz
autopkgtest [04:34:20]: test test-suite: [-----------------------
============================= test session starts
==============================
platform linux -- Python 3.6.6, pytest-3.6.2, py-1.5.3, pluggy-0.6.0
rootdir: /tmp/autopkgtest-lxc.kp73nwdh/downtmp/build.CLj/src, inifile:
setup.cfg
plugins: timeout-1.2.1, helpers-namespace-2017.11.11, cov-2.5.1
collected 168 items
tests/test_hocrtransform.py .
[ 0%]
tests/test_lept.py .
[ 1%]
tests/test_main.py ...............................................F.F...
[ 32%]
..FFF..FFFF...F.........s............FFF......FF.................s.....
[ 75%]
tests/test_metadata.py .....xxxx....
[ 82%]
tests/test_multiprocessing.py .
[ 83%]
tests/test_pageinfo.py ........
[ 88%]
tests/test_qpdf.py .....s
[ 91%]
tests/test_tess3.py sss
[ 93%]
tests/test_tess4.py .....
[ 96%]
tests/test_unpaper.py s..
[ 98%]
tests/test_userunit.py F..
[100%]
=================================== FAILURES
===================================
____________________________ test_invalid_input_pdf
____________________________
resources =
PosixPath('/tmp/autopkgtest-lxc.kp73nwdh/downtmp/build.CLj/src/tests/resources')
no_outpdf =
'/tmp/pytest-of-debci/pytest-0/test_invalid_input_pdf0/no_output.pdf'
def test_invalid_input_pdf(resources, no_outpdf):
p, out, err = run_ocrmypdf(
resources / 'invalid.pdf', no_outpdf)
> assert p.returncode == ExitCode.input_file, err
E AssertionError: ERROR -
/tmp/com.github.ocrmypdf.gl7o6ez6/origin.pdf: not a valid PDF, and could
not repair it.
E ERROR - Details: WARNING:
/tmp/com.github.ocrmypdf.gl7o6ez6/origin.pdf: file is damaged
E WARNING: /tmp/com.github.ocrmypdf.gl7o6ez6/origin.pdf: can't
find startxref
E WARNING: /tmp/com.github.ocrmypdf.gl7o6ez6/origin.pdf:
Attempting to reconstruct cross-reference table
E /tmp/com.github.ocrmypdf.gl7o6ez6/origin.pdf: unable to find
trailer dictionary while recovering damaged file
E
E Traceback (most recent call last):
E File "/usr/lib/python3/dist-packages/ocrmypdf/__main__.py",
line 901, in run_pipeline
E cmdline.run(options)
E File "/usr/lib/python3/dist-packages/ruffus/cmdline.py",
line 824, in run
E **appropriate_options)
E File "/usr/lib/python3/dist-packages/ruffus/task.py", line
5938, in pipeline_run
E raise job_errors
E ruffus.ruffus_exceptions.RethrownJobError:
E
E
E
E Original exception:
E
E Exception #1
E 'ocrmypdf.exceptions.InputFileError' raised in ...
E Task = def ocrmypdf.pipeline.repair_and_parse_pdf(...):
E Job = [.../origin.pdf -> .../origin.repaired.pdf,
<LoggingProxy>, <ocrmypdf.pipeline.JobContext>]
E
E Traceback (most recent call last):
E File
"/usr/lib/python3/dist-packages/ocrmypdf/exec/qpdf.py", line 78, in repair
E check=True)
E File "/usr/lib/python3.6/subprocess.py", line 418, in run
E output=stdout, stderr=stderr)
E subprocess.CalledProcessError: Command '['qpdf',
'/tmp/com.github.ocrmypdf.gl7o6ez6/origin.pdf',
'/tmp/com.github.ocrmypdf.gl7o6ez6/origin.repaired.pdf']' returned
non-zero exit status 2.
E
E The above exception was the direct cause of the following
exception:
E
E Traceback (most recent call last):
E File "/usr/lib/python3/dist-packages/ruffus/task.py",
line 751, in run_pooled_job_without_exceptions
E register_cleanup, touch_files_only)
E File "/usr/lib/python3/dist-packages/ruffus/task.py",
line 567, in job_wrapper_io_files
E ret_val = user_defined_work_func(*params)
E File
"/usr/lib/python3/dist-packages/ocrmypdf/pipeline.py", line 218, in
repair_and_parse_pdf
E qpdf.repair(input_file, output_file, log)
E File
"/usr/lib/python3/dist-packages/ocrmypdf/exec/qpdf.py", line 90, in repair
E raise InputFileError() from e
E ocrmypdf.exceptions.InputFileError
E
E
E
E During handling of the above exception, another exception
occurred:
E
E Traceback (most recent call last):
E File "/usr/lib/python3.6/runpy.py", line 193, in
_run_module_as_main
E "__main__", mod_spec)
E File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
E exec(code, run_globals)
E File "/usr/lib/python3/dist-packages/ocrmypdf/__main__.py",
line 953, in <module>
E sys.exit(run_pipeline())
E File "/usr/lib/python3/dist-packages/ocrmypdf/__main__.py",
line 905, in run_pipeline
E exceptions = e.job_exceptions
E AttributeError: 'RethrownJobError' object has no attribute
'job_exceptions'
E
E assert 1 == <ExitCode.input_file: 2>
E + where 1 = <subprocess.Popen object at 0x7f539492bb00>.returncode
E + and <ExitCode.input_file: 2> = ExitCode.input_file
tests/test_main.py:343: AssertionError
_____________________ test_force_ocr_on_pdf_with_no_images
_____________________
spoof_tesseract_crash = {'ADTTMP':
'/tmp/autopkgtest-lxc.kp73nwdh/downtmp/autopkgtest_tmp',
'ADT_ARTIFACTS':
'/tmp/autopkgtest-lxc.kp73nwdh/do...p73nwdh/downtmp/test-suite-artifacts',
'AUTOPKGTEST_TMP':
'/tmp/autopkgtest-lxc.kp73nwdh/downtmp/autopkgtest_tmp', ...}
resources =
PosixPath('/tmp/autopkgtest-lxc.kp73nwdh/downtmp/build.CLj/src/tests/resources')
no_outpdf =
'/tmp/pytest-of-debci/pytest-0/test_force_ocr_on_pdf_with_no_0/no_output.pdf'
def test_force_ocr_on_pdf_with_no_images(spoof_tesseract_crash,
resources,
no_outpdf):
# As a correctness test, make sure that --force-ocr on a PDF with no
# content still triggers tesseract. If tesseract crashes, then
it was
# called.
p, _, err = run_ocrmypdf(
resources / 'blank.pdf', no_outpdf, '--force-ocr',
env=spoof_tesseract_crash)
> assert p.returncode == ExitCode.child_process_error, err
E AssertionError: WARNING - 1: page has no images - all vector
content will be rasterized at 400 DPI, losing some resolution and likely
increasing file size. Use --oversample to adjust the DPI.
E INFO - 1: [tesseract] KABOOM! Tesseract failed for some
reason
E Traceback (most recent call last):
E File "/usr/lib/python3/dist-packages/ocrmypdf/__main__.py",
line 901, in run_pipeline
E cmdline.run(options)
E File "/usr/lib/python3/dist-packages/ruffus/cmdline.py",
line 824, in run
E **appropriate_options)
E File "/usr/lib/python3/dist-packages/ruffus/task.py", line
5938, in pipeline_run
E raise job_errors
E ruffus.ruffus_exceptions.RethrownJobError:
E
E
E
E Original exception:
E
E Exception #1
E 'subprocess.CalledProcessError(Command '['tesseract',
'-l', 'eng', '-c', 'textonly_pdf=1',
'/tmp/com.github.ocrmypdf.9783lyfl/000001.ocr.png',
'/tmp/com.github.ocrmypdf.9783lyfl/000001.text', 'pdf', 'txt']' returned
non-zero exit status 139.)' raised in ...
E Task = def
ocrmypdf.pipeline.ocr_tesseract_textonly_pdf(...):
E Job = [[.../000001.ocr.oriented.pdf,
.../000001.ocr.png] -> [.../000001.text.pdf, .../000001.text.txt],
<LoggingProxy>, <ocrmypdf.pipeline.JobContext>]
E
E Traceback (most recent call last):
E File "/usr/lib/python3/dist-packages/ruffus/task.py",
line 751, in run_pooled_job_without_exceptions
E register_cleanup, touch_files_only)
E File "/usr/lib/python3/dist-packages/ruffus/task.py",
line 567, in job_wrapper_io_files
E ret_val = user_defined_work_func(*params)
E File
"/usr/lib/python3/dist-packages/ocrmypdf/pipeline.py", line 873, in
ocr_tesseract_textonly_pdf
E log=log)
E File
"/usr/lib/python3/dist-packages/ocrmypdf/exec/tesseract.py", line 371,
in generate_pdf
E raise e from e
E File
"/usr/lib/python3/dist-packages/ocrmypdf/exec/tesseract.py", line 357,
in generate_pdf
E timeout=timeout)
E File "/usr/lib/python3.6/subprocess.py", line 336, in
check_output
E **kwargs).stdout
E File "/usr/lib/python3.6/subprocess.py", line 418, in run
E output=stdout, stderr=stderr)
E subprocess.CalledProcessError: Command '['tesseract',
'-l', 'eng', '-c', 'textonly_pdf=1',
'/tmp/com.github.ocrmypdf.9783lyfl/000001.ocr.png',
'/tmp/com.github.ocrmypdf.9783lyfl/000001.text', 'pdf', 'txt']' returned
non-zero exit status 139.
E
E
E
E During handling of the above exception, another exception
occurred:
E
E Traceback (most recent call last):
E File "/usr/lib/python3.6/runpy.py", line 193, in
_run_module_as_main
E "__main__", mod_spec)
E File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
E exec(code, run_globals)
E File "/usr/lib/python3/dist-packages/ocrmypdf/__main__.py",
line 953, in <module>
E sys.exit(run_pipeline())
E File "/usr/lib/python3/dist-packages/ocrmypdf/__main__.py",
line 905, in run_pipeline
E exceptions = e.job_exceptions
E AttributeError: 'RethrownJobError' object has no attribute
'job_exceptions'
E
E assert 1 == <ExitCode.child_process_error: 7>
E + where 1 = <subprocess.Popen object at 0x7f5394800860>.returncode
E + and <ExitCode.child_process_error: 7> =
ExitCode.child_process_error
tests/test_main.py:360: AssertionError
__________________________ test_input_file_not_a_pdf
___________________________
no_outpdf =
'/tmp/pytest-of-debci/pytest-0/test_input_file_not_a_pdf0/no_output.pdf'
def test_input_file_not_a_pdf(no_outpdf):
input_file = __file__ # Try to OCR this file
p, out, err = run_ocrmypdf(
input_file,
no_outpdf)
> assert p.returncode == ExitCode.input_file
E assert 1 == <ExitCode.input_file: 2>
E + where 1 = <subprocess.Popen object at 0x7f5394800c18>.returncode
E + and <ExitCode.input_file: 2> = ExitCode.input_file
tests/test_main.py:416: AssertionError
____________________________ test_qpdf_repair_fails
____________________________
spoof_qpdf_always_error = {'ADTTMP':
'/tmp/autopkgtest-lxc.kp73nwdh/downtmp/autopkgtest_tmp',
'ADT_ARTIFACTS':
'/tmp/autopkgtest-lxc.kp73nwdh/do...p73nwdh/downtmp/test-suite-artifacts',
'AUTOPKGTEST_TMP':
'/tmp/autopkgtest-lxc.kp73nwdh/downtmp/autopkgtest_tmp', ...}
resources =
PosixPath('/tmp/autopkgtest-lxc.kp73nwdh/downtmp/build.CLj/src/tests/resources')
no_outpdf =
'/tmp/pytest-of-debci/pytest-0/test_qpdf_repair_fails0/no_output.pdf'
def test_qpdf_repair_fails(spoof_qpdf_always_error, resources,
no_outpdf):
p, out, err = run_ocrmypdf(
resources / 'c02-22.pdf', no_outpdf,
'-v', '1',
env=spoof_qpdf_always_error)
print(err)
> assert p.returncode == ExitCode.input_file
E assert 1 == <ExitCode.input_file: 2>
E + where 1 = <subprocess.Popen object at 0x7f53946d85c0>.returncode
E + and <ExitCode.input_file: 2> = ExitCode.input_file
tests/test_main.py:426: AssertionError
----------------------------- Captured stdout call
-----------------------------
DEBUG - ocrmypdf 6.2.2
DEBUG - tesseract 4.0.0-beta.1-262-g555f
DEBUG - qpdf 7.0.0
DEBUG - PyMuPDF not installed
DEBUG -
os.symlink(/tmp/autopkgtest-lxc.kp73nwdh/downtmp/build.CLj/src/tests/resources/c02-22.pdf,
/tmp/com.github.ocrmypdf.ans58xtp/origin)
DEBUG - os.symlink(/tmp/com.github.ocrmypdf.ans58xtp/origin,
/tmp/com.github.ocrmypdf.ans58xtp/origin.pdf)
DEBUG - Beginning qpdf repair...
ERROR - /tmp/com.github.ocrmypdf.ans58xtp/origin.pdf: not a valid PDF,
and could not repair it.
ERROR - Details: qpdf dummy
DEBUG -
Original exception:
Exception #1
'ocrmypdf.exceptions.InputFileError' raised in ...
Task = def ocrmypdf.pipeline.repair_and_parse_pdf(...):
Job = [.../origin.pdf -> .../origin.repaired.pdf,
<LoggingProxy>, <ocrmypdf.pipeline.JobContext>]
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/ocrmypdf/exec/qpdf.py", line
78, in repair
check=True)
File "/usr/lib/python3.6/subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['qpdf',
'/tmp/com.github.ocrmypdf.ans58xtp/origin.pdf',
'/tmp/com.github.ocrmypdf.ans58xtp/origin.repaired.pdf']' returned
non-zero exit status 2.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/ruffus/task.py", line 751, in
run_pooled_job_without_exceptions
register_cleanup, touch_files_only)
File "/usr/lib/python3/dist-packages/ruffus/task.py", line 567, in
job_wrapper_io_files
ret_val = user_defined_work_func(*params)
File "/usr/lib/python3/dist-packages/ocrmypdf/pipeline.py", line
218, in repair_and_parse_pdf
qpdf.repair(input_file, output_file, log)
File "/usr/lib/python3/dist-packages/ocrmypdf/exec/qpdf.py", line
90, in repair
raise InputFileError() from e
ocrmypdf.exceptions.InputFileError
________________________________________
Tasks which will be run:
Task enters queue = 'ocrmypdf.pipeline.triage'
Completed Task = 'ocrmypdf.pipeline.triage'
Task enters queue = 'ocrmypdf.pipeline.repair_and_parse_pdf'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/ocrmypdf/__main__.py", line 901,
in run_pipeline
cmdline.run(options)
File "/usr/lib/python3/dist-packages/ruffus/cmdline.py", line 824, in run
**appropriate_options)
File "/usr/lib/python3/dist-packages/ruffus/task.py", line 5938, in
pipeline_run
raise job_errors
ruffus.ruffus_exceptions.RethrownJobError:
Original exception:
Exception #1
'ocrmypdf.exceptions.InputFileError' raised in ...
Task = def ocrmypdf.pipeline.repair_and_parse_pdf(...):
Job = [.../origin.pdf -> .../origin.repaired.pdf,
<LoggingProxy>, <ocrmypdf.pipeline.JobContext>]
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/ocrmypdf/exec/qpdf.py", line
78, in repair
check=True)
File "/usr/lib/python3.6/subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['qpdf',
'/tmp/com.github.ocrmypdf.ans58xtp/origin.pdf',
'/tmp/com.github.ocrmypdf.ans58xtp/origin.repaired.pdf']' returned
non-zero exit status 2.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/ruffus/task.py", line 751, in
run_pooled_job_without_exceptions
register_cleanup, touch_files_only)
File "/usr/lib/python3/dist-packages/ruffus/task.py", line 567, in
job_wrapper_io_files
ret_val = user_defined_work_func(*params)
File "/usr/lib/python3/dist-packages/ocrmypdf/pipeline.py", line
218, in repair_and_parse_pdf
qpdf.repair(input_file, output_file, log)
File "/usr/lib/python3/dist-packages/ocrmypdf/exec/qpdf.py", line
90, in repair
raise InputFileError() from e
ocrmypdf.exceptions.InputFileError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/lib/python3/dist-packages/ocrmypdf/__main__.py", line 953,
in <module>
sys.exit(run_pipeline())
File "/usr/lib/python3/dist-packages/ocrmypdf/__main__.py", line 905,
in run_pipeline
exceptions = e.job_exceptions
AttributeError: 'RethrownJobError' object has no attribute 'job_exceptions'
________________________________ test_encrypted
________________________________
resources =
PosixPath('/tmp/autopkgtest-lxc.kp73nwdh/downtmp/build.CLj/src/tests/resources')
no_outpdf = '/tmp/pytest-of-debci/pytest-0/test_encrypted0/no_output.pdf'
def test_encrypted(resources, no_outpdf):
p, out, err = run_ocrmypdf(
resources / 'skew-encrypted.pdf', no_outpdf)
> assert p.returncode == ExitCode.encrypted_pdf
E assert 1 == <ExitCode.encrypted_pdf: 8>
E + where 1 = <subprocess.Popen object at 0x7f53948009b0>.returncode
E + and <ExitCode.encrypted_pdf: 8> = ExitCode.encrypted_pdf
tests/test_main.py:432: AssertionError
__________________________ test_tesseract_crash[hocr]
__________________________
renderer = 'hocr'
spoof_tesseract_crash = {'ADTTMP':
'/tmp/autopkgtest-lxc.kp73nwdh/downtmp/autopkgtest_tmp',
'ADT_ARTIFACTS':
'/tmp/autopkgtest-lxc.kp73nwdh/do...p73nwdh/downtmp/test-suite-artifacts',
'AUTOPKGTEST_TMP':
'/tmp/autopkgtest-lxc.kp73nwdh/downtmp/autopkgtest_tmp', ...}
resources =
PosixPath('/tmp/autopkgtest-lxc.kp73nwdh/downtmp/build.CLj/src/tests/resources')
no_outpdf =
'/tmp/pytest-of-debci/pytest-0/test_tesseract_crash_hocr_0/no_output.pdf'
@pytest.mark.parametrize('renderer', RENDERERS)
def test_tesseract_crash(renderer, spoof_tesseract_crash,
resources, no_outpdf):
p, out, err = run_ocrmypdf(
resources / 'ccitt.pdf', no_outpdf, '-v', '1',
'--pdf-renderer', renderer, env=spoof_tesseract_crash)
> assert p.returncode == ExitCode.child_process_error
E assert 1 == <ExitCode.child_process_error: 7>
E + where 1 = <subprocess.Popen object at 0x7f53947d2940>.returncode
E + and <ExitCode.child_process_error: 7> =
ExitCode.child_process_error
tests/test_main.py:454: AssertionError
_______________________ test_tesseract_crash[tesseract]
________________________
renderer = 'tesseract'
spoof_tesseract_crash = {'ADTTMP':
'/tmp/autopkgtest-lxc.kp73nwdh/downtmp/autopkgtest_tmp',
'ADT_ARTIFACTS':
'/tmp/autopkgtest-lxc.kp73nwdh/do...p73nwdh/downtmp/test-suite-artifacts',
'AUTOPKGTEST_TMP':
'/tmp/autopkgtest-lxc.kp73nwdh/downtmp/autopkgtest_tmp', ...}
resources =
PosixPath('/tmp/autopkgtest-lxc.kp73nwdh/downtmp/build.CLj/src/tests/resources')
no_outpdf =
'/tmp/pytest-of-debci/pytest-0/test_tesseract_crash_tesseract0/no_output.pdf'
@pytest.mark.parametrize('renderer', RENDERERS)
def test_tesseract_crash(renderer, spoof_tesseract_crash,
resources, no_outpdf):
p, out, err = run_ocrmypdf(
resources / 'ccitt.pdf', no_outpdf, '-v', '1',
'--pdf-renderer', renderer, env=spoof_tesseract_crash)
> assert p.returncode == ExitCode.child_process_error
E assert 1 == <ExitCode.child_process_error: 7>
E + where 1 = <subprocess.Popen object at 0x7f53947d2908>.returncode
E + and <ExitCode.child_process_error: 7> =
ExitCode.child_process_error
tests/test_main.py:454: AssertionError
________________________ test_tesseract_crash[sandwich]
________________________
renderer = 'sandwich'
spoof_tesseract_crash = {'ADTTMP':
'/tmp/autopkgtest-lxc.kp73nwdh/downtmp/autopkgtest_tmp',
'ADT_ARTIFACTS':
'/tmp/autopkgtest-lxc.kp73nwdh/do...p73nwdh/downtmp/test-suite-artifacts',
'AUTOPKGTEST_TMP':
'/tmp/autopkgtest-lxc.kp73nwdh/downtmp/autopkgtest_tmp', ...}
resources =
PosixPath('/tmp/autopkgtest-lxc.kp73nwdh/downtmp/build.CLj/src/tests/resources')
no_outpdf =
'/tmp/pytest-of-debci/pytest-0/test_tesseract_crash_sandwich_0/no_output.pdf'
@pytest.mark.parametrize('renderer', RENDERERS)
def test_tesseract_crash(renderer, spoof_tesseract_crash,
resources, no_outpdf):
p, out, err = run_ocrmypdf(
resources / 'ccitt.pdf', no_outpdf, '-v', '1',
'--pdf-renderer', renderer, env=spoof_tesseract_crash)
> assert p.returncode == ExitCode.child_process_error
E assert 1 == <ExitCode.child_process_error: 7>
E + where 1 = <subprocess.Popen object at 0x7f53948815c0>.returncode
E + and <ExitCode.child_process_error: 7> =
ExitCode.child_process_error
tests/test_main.py:454: AssertionError
_______________________ test_tesseract_crash_autorotate
________________________
spoof_tesseract_crash = {'ADTTMP':
'/tmp/autopkgtest-lxc.kp73nwdh/downtmp/autopkgtest_tmp',
'ADT_ARTIFACTS':
'/tmp/autopkgtest-lxc.kp73nwdh/do...p73nwdh/downtmp/test-suite-artifacts',
'AUTOPKGTEST_TMP':
'/tmp/autopkgtest-lxc.kp73nwdh/downtmp/autopkgtest_tmp', ...}
resources =
PosixPath('/tmp/autopkgtest-lxc.kp73nwdh/downtmp/build.CLj/src/tests/resources')
no_outpdf =
'/tmp/pytest-of-debci/pytest-0/test_tesseract_crash_autorotat0/no_output.pdf'
def test_tesseract_crash_autorotate(spoof_tesseract_crash,
resources, no_outpdf):
p, out, err = run_ocrmypdf(
resources / 'ccitt.pdf', no_outpdf,
'-r', env=spoof_tesseract_crash)
> assert p.returncode == ExitCode.child_process_error
E assert 1 == <ExitCode.child_process_error: 7>
E + where 1 = <subprocess.Popen object at 0x7f53947e9e10>.returncode
E + and <ExitCode.child_process_error: 7> =
ExitCode.child_process_error
tests/test_main.py:464: AssertionError
__________________________________ test_algo4
__________________________________
resources =
PosixPath('/tmp/autopkgtest-lxc.kp73nwdh/downtmp/build.CLj/src/tests/resources')
no_outpdf = '/tmp/pytest-of-debci/pytest-0/test_algo40/no_output.pdf'
def test_algo4(resources, no_outpdf):
p, _, _ = run_ocrmypdf(resources / 'encrypted_algo4.pdf', no_outpdf)
> assert p.returncode == ExitCode.encrypted_pdf
E assert 1 == <ExitCode.encrypted_pdf: 8>
E + where 1 = <subprocess.Popen object at 0x7f53947e9978>.returncode
E + and <ExitCode.encrypted_pdf: 8> = ExitCode.encrypted_pdf
tests/test_main.py:483: AssertionError
_____________________ test_tesseract_config_invalid[hocr]
______________________
renderer = 'hocr'
resources =
PosixPath('/tmp/autopkgtest-lxc.kp73nwdh/downtmp/build.CLj/src/tests/resources')
outdir =
PosixPath('/tmp/pytest-of-debci/pytest-0/test_tesseract_config_invalid_0')
@pytest.mark.parametrize('renderer', RENDERERS)
def test_tesseract_config_invalid(renderer, resources, outdir):
cfg_file = outdir / 'test.cfg'
with cfg_file.open('w') as f:
f.write('''\
THIS FILE IS INVALID
''')
p, out, err = run_ocrmypdf(
resources / 'ccitt.pdf', outdir / 'out.pdf',
'--pdf-renderer', renderer,
'--tesseract-config', cfg_file)
assert "parameter not found" in err, "No error message"
> assert p.returncode == ExitCode.invalid_config
E assert 1 == <ExitCode.invalid_config: 9>
E + where 1 = <subprocess.Popen object at 0x7f53946c3128>.returncode
E + and <ExitCode.invalid_config: 9> = ExitCode.invalid_config
tests/test_main.py:738: AssertionError
___________________ test_tesseract_config_invalid[tesseract]
___________________
renderer = 'tesseract'
resources =
PosixPath('/tmp/autopkgtest-lxc.kp73nwdh/downtmp/build.CLj/src/tests/resources')
outdir =
PosixPath('/tmp/pytest-of-debci/pytest-0/test_tesseract_config_invalid_1')
@pytest.mark.parametrize('renderer', RENDERERS)
def test_tesseract_config_invalid(renderer, resources, outdir):
cfg_file = outdir / 'test.cfg'
with cfg_file.open('w') as f:
f.write('''\
THIS FILE IS INVALID
''')
p, out, err = run_ocrmypdf(
resources / 'ccitt.pdf', outdir / 'out.pdf',
'--pdf-renderer', renderer,
'--tesseract-config', cfg_file)
assert "parameter not found" in err, "No error message"
> assert p.returncode == ExitCode.invalid_config
E assert 1 == <ExitCode.invalid_config: 9>
E + where 1 = <subprocess.Popen object at 0x7f53946c3ac8>.returncode
E + and <ExitCode.invalid_config: 9> = ExitCode.invalid_config
tests/test_main.py:738: AssertionError
___________________ test_tesseract_config_invalid[sandwich]
____________________
renderer = 'sandwich'
resources =
PosixPath('/tmp/autopkgtest-lxc.kp73nwdh/downtmp/build.CLj/src/tests/resources')
outdir =
PosixPath('/tmp/pytest-of-debci/pytest-0/test_tesseract_config_invalid_2')
@pytest.mark.parametrize('renderer', RENDERERS)
def test_tesseract_config_invalid(renderer, resources, outdir):
cfg_file = outdir / 'test.cfg'
with cfg_file.open('w') as f:
f.write('''\
THIS FILE IS INVALID
''')
p, out, err = run_ocrmypdf(
resources / 'ccitt.pdf', outdir / 'out.pdf',
'--pdf-renderer', renderer,
'--tesseract-config', cfg_file)
assert "parameter not found" in err, "No error message"
> assert p.returncode == ExitCode.invalid_config
E assert 1 == <ExitCode.invalid_config: 9>
E + where 1 = <subprocess.Popen object at 0x7f5394881588>.returncode
E + and <ExitCode.invalid_config: 9> = ExitCode.invalid_config
tests/test_main.py:738: AssertionError
____________________________ test_gs_render_failure
____________________________
spoof_no_tess_gs_render_fail = {'ADTTMP':
'/tmp/autopkgtest-lxc.kp73nwdh/downtmp/autopkgtest_tmp',
'ADT_ARTIFACTS':
'/tmp/autopkgtest-lxc.kp73nwdh/do...p73nwdh/downtmp/test-suite-artifacts',
'AUTOPKGTEST_TMP':
'/tmp/autopkgtest-lxc.kp73nwdh/downtmp/autopkgtest_tmp', ...}
resources =
PosixPath('/tmp/autopkgtest-lxc.kp73nwdh/downtmp/build.CLj/src/tests/resources')
outpdf = '/tmp/pytest-of-debci/pytest-0/test_gs_render_failure0/out.pdf'
def test_gs_render_failure(spoof_no_tess_gs_render_fail, resources,
outpdf):
p, out, err = run_ocrmypdf(
resources / 'blank.pdf', outpdf,
env=spoof_no_tess_gs_render_fail)
print(err)
> assert p.returncode == ExitCode.child_process_error
E assert 1 == <ExitCode.child_process_error: 7>
E + where 1 = <subprocess.Popen object at 0x7f53948b0208>.returncode
E + and <ExitCode.child_process_error: 7> =
ExitCode.child_process_error
tests/test_main.py:811: AssertionError
----------------------------- Captured stdout call
-----------------------------
ERROR - ERROR: Casper is not a friendly ghost
ERROR - Ghostscript PDF/A rendering failed
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/ocrmypdf/__main__.py", line 901,
in run_pipeline
cmdline.run(options)
File "/usr/lib/python3/dist-packages/ruffus/cmdline.py", line 824, in run
**appropriate_options)
File "/usr/lib/python3/dist-packages/ruffus/task.py", line 5938, in
pipeline_run
raise job_errors
ruffus.ruffus_exceptions.RethrownJobError:
Original exception:
Exception #1
'ocrmypdf.exceptions.SubprocessOutputError' raised in ...
Task = def ocrmypdf.pipeline.merge_pages_ghostscript(...):
Job = [[.../000001.rendered.pdf, .../pdfa.ps] -> .../merged.pdf,
<LoggingProxy>, <ocrmypdf.pipeline.JobContext>]
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/ruffus/task.py", line 751, in
run_pooled_job_without_exceptions
register_cleanup, touch_files_only)
File "/usr/lib/python3/dist-packages/ruffus/task.py", line 567, in
job_wrapper_io_files
ret_val = user_defined_work_func(*params)
File "/usr/lib/python3/dist-packages/ocrmypdf/pipeline.py", line
987, in merge_pages_ghostscript
pdfa_part=options.output_type[-1]) # is pdfa-1, pdfa-2, or pdfa-3
File
"/usr/lib/python3/dist-packages/ocrmypdf/exec/ghostscript.py", line 194,
in generate_pdfa
raise SubprocessOutputError()
ocrmypdf.exceptions.SubprocessOutputError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/lib/python3/dist-packages/ocrmypdf/__main__.py", line 953,
in <module>
sys.exit(run_pipeline())
File "/usr/lib/python3/dist-packages/ocrmypdf/__main__.py", line 905,
in run_pipeline
exceptions = e.job_exceptions
AttributeError: 'RethrownJobError' object has no attribute 'job_exceptions'
____________________________ test_gs_raster_failure
____________________________
spoof_no_tess_gs_raster_fail = {'ADTTMP':
'/tmp/autopkgtest-lxc.kp73nwdh/downtmp/autopkgtest_tmp',
'ADT_ARTIFACTS':
'/tmp/autopkgtest-lxc.kp73nwdh/do...p73nwdh/downtmp/test-suite-artifacts',
'AUTOPKGTEST_TMP':
'/tmp/autopkgtest-lxc.kp73nwdh/downtmp/autopkgtest_tmp', ...}
resources =
PosixPath('/tmp/autopkgtest-lxc.kp73nwdh/downtmp/build.CLj/src/tests/resources')
outpdf = '/tmp/pytest-of-debci/pytest-0/test_gs_raster_failure0/out.pdf'
def test_gs_raster_failure(spoof_no_tess_gs_raster_fail, resources,
outpdf):
p, out, err = run_ocrmypdf(
resources / 'ccitt.pdf', outpdf,
env=spoof_no_tess_gs_raster_fail)
print(err)
> assert p.returncode == ExitCode.child_process_error
E assert 1 == <ExitCode.child_process_error: 7>
E + where 1 = <subprocess.Popen object at 0x7f53946bc898>.returncode
E + and <ExitCode.child_process_error: 7> =
ExitCode.child_process_error
tests/test_main.py:819: AssertionError
----------------------------- Captured stdout call
-----------------------------
ERROR - ERROR: Ghost story archive not found
ERROR - Ghostscript rasterizing failed
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/ocrmypdf/__main__.py", line 901,
in run_pipeline
cmdline.run(options)
File "/usr/lib/python3/dist-packages/ruffus/cmdline.py", line 824, in run
**appropriate_options)
File "/usr/lib/python3/dist-packages/ruffus/task.py", line 5938, in
pipeline_run
raise job_errors
ruffus.ruffus_exceptions.RethrownJobError:
Original exception:
Exception #1
'ocrmypdf.exceptions.SubprocessOutputError' raised in ...
Task = def ocrmypdf.pipeline.rasterize_with_ghostscript(...):
Job = [.../000001.ocr.oriented.pdf -> .../000001.page.png,
<LoggingProxy>, <ocrmypdf.pipeline.JobContext>]
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/ruffus/task.py", line 751, in
run_pooled_job_without_exceptions
register_cleanup, touch_files_only)
File "/usr/lib/python3/dist-packages/ruffus/task.py", line 567, in
job_wrapper_io_files
ret_val = user_defined_work_func(*params)
File "/usr/lib/python3/dist-packages/ocrmypdf/pipeline.py", line
527, in rasterize_with_ghostscript
raster_device=device, log=log, page_dpi=(page_dpi, page_dpi))
File
"/usr/lib/python3/dist-packages/ocrmypdf/exec/ghostscript.py", line 98,
in rasterize_pdf
raise SubprocessOutputError()
ocrmypdf.exceptions.SubprocessOutputError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/lib/python3/dist-packages/ocrmypdf/__main__.py", line 953,
in <module>
sys.exit(run_pipeline())
File "/usr/lib/python3/dist-packages/ocrmypdf/__main__.py", line 905,
in run_pipeline
exceptions = e.job_exceptions
AttributeError: 'RethrownJobError' object has no attribute 'job_exceptions'
_______________________ test_userunit_ghostscript_fails
________________________
poster =
PosixPath('/tmp/autopkgtest-lxc.kp73nwdh/downtmp/build.CLj/src/tests/resources/poster.pdf')
no_outpdf =
'/tmp/pytest-of-debci/pytest-0/test_userunit_ghostscript_fail0/no_output.pdf'
def test_userunit_ghostscript_fails(poster, no_outpdf):
p, out, err = run_ocrmypdf(poster, no_outpdf, '--output-type=pdfa')
> assert p.returncode == ExitCode.input_file
E assert 1 == <ExitCode.input_file: 2>
E + where 1 = <subprocess.Popen object at 0x7f539486fb38>.returncode
E + and <ExitCode.input_file: 2> = ExitCode.input_file
tests/test_userunit.py:44: AssertionError
======== 16 failed, 141 passed, 7 skipped, 4 xfailed in 1053.38 seconds
========
autopkgtest [04:51:54]: test test-suite: -----------------------]
signature.asc
Description: OpenPGP digital signature
--- End Message ---