PyMuPDF icon indicating copy to clipboard operation
PyMuPDF copied to clipboard

test_textbox3 failing with v1.24.2

Open Antiz96 opened this issue 1 year ago • 0 comments

Description of the bug

Hello,

The test_textbox3 (in test_textbox.py) is failing with v1.24.2 (but passes fine with v1.24.1):

==================================== ERRORS ====================================
______________________ ERROR at teardown of test_textbox3 ______________________

args = (), kwargs = {}, wt = 'format error: Reserved charstring byte'
@py_assert1 = False
@py_format2 = "Warnings text not empty: wt='format error: Reserved charstring byte'\n>assert not 'format error: Reserved charstring byte'"
rep = None

    @pytest.fixture(autouse=True)
    def wrap(*args, **kwargs):
        '''
        Check that tests return with empty MuPDF warnings buffer. For example this
        detects failure to call fz_close_output() before fz_drop_output(), which
        (as of 2024-4-12) generates a warning from MuPDF.
        '''
        wt = fitz.TOOLS.mupdf_warnings()
        assert not wt, f'{wt=}'

        # Run the test.
        rep = yield

        # Test has run; check it did not create any MuPDF warnings.
        wt = fitz.TOOLS.mupdf_warnings()
        if not hasattr(fitz, 'mupdf'):
            print(f'Not checking mupdf_warnings on classic.')
        else:
>           assert not wt, f'Warnings text not empty: {wt=}'
E           AssertionError: Warnings text not empty: wt='format error: Reserved charstring byte'
E           assert not 'format error: Reserved charstring byte'

tests/conftest.py:22: AssertionError
----------------------------- Captured stderr call -----------------------------
MuPDF error: format error: Reserved charstring byte
=========================== short test summary info ============================
ERROR tests/test_textbox.py::test_textbox3 - AssertionError: Warnings text no...

cc @dvzrv

How to reproduce the bug

  • Compile pymupdf v1.24.2
  • Run tests and see the above one failing

(Tested on both Python 3.11 and 3.12 FWIW)

PyMuPDF version

1.24.2

Operating system

Linux

Python version

3.11

Antiz96 avatar Apr 18 '24 08:04 Antiz96