@@ -398,42 +398,3 @@ def test_prevent_gs_invalid_xml(resources, outdir):
398
398
# Ensure we did not carry the nul forward.
399
399
assert contents .find (b'�' , xmp_start , xmp_end ) == - 1 , "found escaped nul"
400
400
assert contents .find (b'\x00 ' , xmp_start , xmp_end ) == - 1
401
-
402
-
403
- @pytest .mark .xfail (
404
- ghostscript .version () >= Version ('10.01.2' ),
405
- reason = (
406
- "Ghostscript now exits with an error on invalid DocumentInfo, defeating "
407
- "this test." ,
408
- ),
409
- )
410
- def test_malformed_docinfo (caplog , resources , outdir ):
411
- generate_pdfa_ps (outdir / 'pdfa.ps' )
412
-
413
- with pikepdf .open (resources / 'trivial.pdf' ) as pdf :
414
- pdf .trailer .Info = pikepdf .Stream (pdf , b"<xml></xml>" )
415
- pdf .save (outdir / 'layers.rendered.pdf' , fix_metadata_version = False )
416
-
417
- _ , options , _ = get_parser_options_plugins (
418
- args = [
419
- '-j' ,
420
- '1' ,
421
- '--output-type' ,
422
- 'pdfa-2' ,
423
- 'a.pdf' ,
424
- 'b.pdf' ,
425
- ]
426
- )
427
- pdfinfo = PdfInfo (outdir / 'layers.rendered.pdf' )
428
- context = PdfContext (
429
- options , outdir , outdir / 'layers.rendered.pdf' , pdfinfo , get_plugin_manager ([])
430
- )
431
-
432
- convert_to_pdfa (
433
- str (outdir / 'layers.rendered.pdf' ), str (outdir / 'pdfa.ps' ), context
434
- )
435
-
436
- print (caplog .records )
437
- assert any (
438
- 'malformed DocumentInfo block' in record .message for record in caplog .records
439
- )
0 commit comments