You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This following exception happens on gentoo when calling surface.write_to_png() after using rsvg to render an svg.
python 3.6
cairo 1.14.8
cairocffi 0.8.0, installed from pip
the code works on other operating systems (tested on arch), so i guess it's some dependency problem. what could it be?
Traceback (most recent call last):
[…]
File "/opt/c3nav/instances/34c3/c3nav/src/c3nav/mapdata/utils/svg.py", line 92, in get_png
f.write(surface.write_to_png())
File "/opt/c3nav/instances/34c3/env/lib/python3.6/site-packages/cairocffi/surfaces.py", line 593, in write_to_png
write_func = _make_write_func(target)
File "/opt/c3nav/instances/34c3/env/lib/python3.6/site-packages/cairocffi/surfaces.py", line 42, in _make_write_func
@ffi.callback("cairo_write_func_t", error=constants.STATUS_WRITE_ERROR)
SystemError: <built-in method callback_decorator of tuple object at 0x676b04d14d18> returned NULL without setting an error
the exception can be triggered easily in a python shell:
>>> import cairocffi
>>> surface = cairocffi.SVGSurface(None, 10, 10)
>>> print(surface.write_to_png())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/c3nav/instances/34c3/env/lib/python3.6/site-packages/cairocffi/surfaces.py", line 593, in write_to_png
write_func = _make_write_func(target)
File "/opt/c3nav/instances/34c3/env/lib/python3.6/site-packages/cairocffi/surfaces.py", line 42, in _make_write_func
@ffi.callback("cairo_write_func_t", error=constants.STATUS_WRITE_ERROR)
SystemError: <built-in method callback_decorator of tuple object at 0x752d9f20fc78> returned NULL without setting an error
>>> surface = cairocffi.SVGSurface(None, 10, 10)
The text was updated successfully, but these errors were encountered:
I found the source. The Problem is that your code uses old-style callbacks, which do not work on hardened systems. The solution would be to convert your callbacks to new-style callbacks. I would offer a pull request, but as cairocffi uses cffi in ABI mode, it is not possible to use them. So i guess i'll have to un-harden the server i want to run it on or look for other cairo bindings. 😞
This following exception happens on gentoo when calling surface.write_to_png() after using rsvg to render an svg.
the code works on other operating systems (tested on arch), so i guess it's some dependency problem. what could it be?
the exception can be triggered easily in a python shell:
The text was updated successfully, but these errors were encountered: