Bug 2057885 - python-kajiki fails to build with Python 3.11: TypeError: code expected at least 18 arguments, got 16
Summary: python-kajiki fails to build with Python 3.11: TypeError: code expected at le...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-kajiki
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Fedora Infrastructure SIG
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.11
TreeView+ depends on / blocked
 
Reported: 2022-02-24 07:17 UTC by Tomáš Hrnčiar
Modified: 2022-05-16 14:26 UTC (History)
7 users (show)

Fixed In Version: python-kajiki-0.9.1-1.fc37
Clone Of:
Environment:
Last Closed: 2022-05-16 14:26:40 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2022-02-24 07:17:23 UTC
python-kajiki fails to build with Python 3.11.0a5.

+ /usr/bin/pytest
============================= test session starts ==============================
platform linux -- Python 3.11.0a5, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /builddir/build/BUILD/kajiki-0.9.0
collected 154 items

kajiki/tests/test_cli.py ........                                        [  5%]
kajiki/tests/test_doctype.py ..                                          [  6%]
kajiki/tests/test_e2e.py FF.F                                            [  9%]
kajiki/tests/test_ir.py FFFFFFFF                                         [ 14%]
kajiki/tests/test_runtime.py ........                                    [ 19%]
kajiki/tests/test_text.py FFFFFFFFFFFFFFFFFFFFFFFF                       [ 35%]
kajiki/tests/test_xml.py ..FFFFFFFFFF.FFFFFFFFFFFFFFFF.F.FFFFFFFFFFFFFFF [ 65%]
FFFFFFFFFFFFFFFFFFFFFFFFFFF.F.FFFFF..F.FF...FF.FF.F..                    [100%]

=================================== FAILURES ===================================
__________________ test_golden_file[args0-kitchensink1.html] ___________________

args = ['-p', 'kajiki.tests.data.kitchensink']
golden_file = 'kitchensink1.html'
capsys = <_pytest.capture.CaptureFixture object at 0x7ff00480d150>

    @pytest.mark.parametrize(
        ["args", "golden_file"],
        [
            (["-p", "kajiki.tests.data.kitchensink"], "kitchensink1.html"),
            ([str(DATA / "kitchensink.html")], "kitchensink1.html"),
        ],
    )
    def test_golden_file(args, golden_file, capsys):
        with open(str(GOLDEN / golden_file)) as f:
            golden_data = f.read()
    
>       main(args)

kajiki/tests/test_e2e.py:24: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
kajiki/__main__.py:90: in main
    template = loader.import_(opts.file_or_package)
kajiki/loader.py:83: in import_
    return super().import_(name, *args, **kwargs)
kajiki/loader.py:17: in import_
    mod = self._load(name, *args, **kwargs)
kajiki/loader.py:113: in _load
    return self.extension_map[ext](
kajiki/loader.py:66: in <lambda>
    html=lambda *a, **kw: XMLTemplate(mode="html", *a, **kw),
kajiki/xml_template.py:62: in XMLTemplate
    t = template.from_ir(ir_, base_globals=base_globals)
kajiki/template.py:336: in from_ir
    tpl.annotate_lnotab(py_linenos)
kajiki/template.py:267: in annotate_lnotab
    meth.annotate_lnotab(cls.filename, py_to_tpl, dict(py_to_tpl))
kajiki/template.py:397: in annotate_lnotab
    new_code = patch_code_file_lines(code, filename, new_firstlineno, new_lnotab)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

code = <code object __main__ at 0x7ff0046cb830, file "<string>", line 2>
filename = '/builddir/build/BUILD/kajiki-0.9.0/kajiki/tests/data/kitchensink.html'
firstlineno = 0, lnotab = b'\x00\x00\x06\x01\x08\x01'

    def patch_code_file_lines(code, filename, firstlineno, lnotab):
        code_args = [code.co_argcount]
        if version_info >= (3, 8):
            code_args.append(code.co_posonlyargcount)
        code_args.extend(
            [
                code.co_kwonlyargcount,
                code.co_nlocals,
                code.co_stacksize,
                code.co_flags,
                code.co_code,
                code.co_consts,
                code.co_names,
                code.co_varnames,
                filename,
                code.co_name,
                firstlineno,
                lnotab,
                code.co_freevars,
                code.co_cellvars,
            ]
        )
>       return types.CodeType(*code_args)
E       TypeError: code expected at least 18 arguments, got 16

kajiki/template.py:424: TypeError

https://docs.python.org/3.11/whatsnew/3.11.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/03527173-python-kajiki/

For all our attempts to build python-kajiki with Python 3.11, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/python-kajiki/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.11:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/

Let us know here if you have any questions.

Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Jan ONDREJ 2022-02-25 07:16:18 UTC
Reported upstream:
https://github.com/jackrosenthal/kajiki/issues/65


Note You need to log in before you can comment on or make changes to this bug.