Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ttfautohint doesn't work on pypy3, fails with ctypes errors #11

Open
anthrotype opened this issue Jan 28, 2022 · 0 comments
Open

ttfautohint doesn't work on pypy3, fails with ctypes errors #11

anthrotype opened this issue Jan 28, 2022 · 0 comments

Comments

@anthrotype
Copy link
Member

Getting the following test failures on pypy3.8 on Mac. I'll need to take some time to investigate this. In the meantime, I'll probably disable ttfautohint-py in fontmake for pypy3.

tests/test_info.py::test_info_name_id_5[1-0-no-previous-info-detailed] FAILED                                                                 [ 10%]

===================================================================== FAILURES ======================================================================
________________________________________________ test_info_name_id_5[1-0-no-previous-info-detailed] _________________________________________________

self = <class 'ctypes.py_object'>, value = {}

    def from_param(self, value):
        if isinstance(value, self):
            return value
        try:
>           as_parameter = value._as_parameter_
E           AttributeError: 'dict' object has no attribute '_as_parameter_'

../../Downloads/pypy3.8-v7.3.7-osx64/lib/pypy3.8/_ctypes/basics.py:56: AttributeError

During handling of the above exception, another exception occurred:

plat_id = 1, enc_id = 0, detailed_info = True, font_version = 'Version 1.000', previous_info = '', appendix = ''

    @pytest.mark.parametrize(
        "detailed_info",
        [True, False],
        ids=["detailed", "no_detailed"]
    )
    @pytest.mark.parametrize(
        "font_version, previous_info, appendix",
        [
            ("Version 1.000", "", ""),
            ("Version 1.000", "; ttfautohint (v1.5)", ""),
            ("Version 1.000", "; ttfautohint (v1.5)", "; foo bar"),
        ],
        ids=[
            "no-previous-info",
            "previous-info-last",
            "previous-info-not-last",
        ]
    )
    @pytest.mark.parametrize(
        "plat_id, enc_id",
        [(1, 0), (3, 1), (3, 10)],
    )
    def test_info_name_id_5(plat_id, enc_id, detailed_info, font_version,
                            previous_info, appendix):
        info_string = TEST_INFO_DETAILED if detailed_info else TEST_INFO
>       info_data = InfoData(info_string)

tests/test_info.py:95:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.venv-pypy/lib/pypy3.8/site-packages/ttfautohint/info.py:108: in __init__
    super(InfoData, self).__init__(info_string, family_suffix, family_data)
../../Downloads/pypy3.8-v7.3.7-osx64/lib/pypy3.8/_ctypes/structure.py:302: in __init__
    self.__setattr__(name, arg)
../../Downloads/pypy3.8-v7.3.7-osx64/lib/pypy3.8/_ctypes/structure.py:135: in __set__
    cobj = fieldtype.from_param(value)
../../Downloads/pypy3.8-v7.3.7-osx64/lib/pypy3.8/_ctypes/primitive.py:382: in from_param
    return super(SimpleType, self).from_param(value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <class 'ctypes.py_object'>, value = {}

    def from_param(self, value):
        if isinstance(value, self):
            return value
        try:
            as_parameter = value._as_parameter_
        except AttributeError:
            raise TypeError("expected %s instance instead of %s" % (
>               self.__name__, type(value).__name__))
E           TypeError: expected py_object instance instead of dict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant