-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Since swig-4.4.0 was uploaded to pypi.org a few hours ago, PyMuPDF tests have started failing on MacOS x86_64 and arm64.
- Tests are still passing on Linux and Windows.
- Tests pass fine on MacOS x86_64 and arm64 if we force the use of swig-4.3.1.
PyMuPDF and MuPDF are quite complicated and i haven't yet created a small reproducer, but i though it was worth creating this issue now because this could be quite a serious regression in swig. (Unless of course it's exposing something wrong in our code.)
For example output see Github workflow results at: https://github.com/pymupdf/PyMuPDF/actions/runs/18866039539/job/53833771115. PyMuPDF/MuPDF
The failures seem to be caused by exceptions in Director callbacks.
First there is:
Director error: <class 'TypeError'>: SWIG director type mismatch in output value of type '::fz_font *'
[fz_font is a C struct in MuPDF, wrapped by SWIG. I don't know what function (that returns a fz_font*) is being called here.]
We have code that prints information about exceptions in Director callbacks, and this seems to be failing with:
Director error: <class 'AttributeError'>: 'EncodedFile' object has no attribute 'write'
I don't know what EncodedFile is - there's no such struct/class in MuPDF or PyMuPDF.
Thanks.