Bug 2050073 - python-Automat fails to build with Python 3.11: TypeError: code expected at least 18 arguments, got 16
Summary: python-Automat fails to build with Python 3.11: TypeError: code expected at l...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-Automat
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Robert-André Mauchin 🐧
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.11
TreeView+ depends on / blocked
 
Reported: 2022-02-03 07:45 UTC by Tomáš Hrnčiar
Modified: 2022-02-15 00:23 UTC (History)
5 users (show)

Fixed In Version: python-Automat-20.2.0-11.fc37 python-Automat-20.2.0-11.fc36
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-02-14 23:35:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2022-02-03 07:45:48 UTC
python-Automat fails to build with Python 3.11.0a4.


=================================== FAILURES ===================================
______________ MethodicalTests.test_badTransitionForCurrentState _______________

self = <automat._test.test_methodical.MethodicalTests testMethod=test_badTransitionForCurrentState>

    def test_badTransitionForCurrentState(self):
        """
        Calling any input method that lacks a transition for the machine's
        current state raises an informative L{NoTransition}.
        """
    
        class OnlyOnePath(object):
            m = MethodicalMachine()
            @m.state(initial=True)
            def start(self):
                "Start state."
            @m.state()
            def end(self):
                "End state."
            @m.input()
            def advance(self):
                "Move from start to end."
            @m.input()
            def deadEnd(self):
                "A transition from nowhere to nowhere."
            start.upon(advance, end, [])
    
        machine = OnlyOnePath()
        with self.assertRaises(NoTransition) as cm:
>           machine.deadEnd()

automat/_test/test_methodical.py:466: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
automat/_methodical.py:232: in __get__
    @preserveName(self.method)
automat/_introspection.py:43: in decorator
    return copyfunction(decorated,
automat/_introspection.py:35: in copyfunction
    return function(copycode(template.__code__, codechanges), *values)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def copycode(template, changes):
        names = [
            "argcount", "nlocals", "stacksize", "flags", "code", "consts",
            "names", "varnames", "filename", "name", "firstlineno", "lnotab",
            "freevars", "cellvars"
        ]
        if hasattr(code, "co_kwonlyargcount"):
            names.insert(1, "kwonlyargcount")
        if hasattr(code, "co_posonlyargcount"):
            # PEP 570 added "positional only arguments"
            names.insert(1, "posonlyargcount")
        values = [
            changes.get(name, getattr(template, "co_" + name))
            for name in names
        ]
>       return code(*values)
E       TypeError: code expected at least 18 arguments, got 16

automat/_introspection.py:23: TypeError
_____________________ MethodicalTests.test_collectOutputs ______________________

self = <automat._test.test_methodical.MethodicalTests testMethod=test_collectOutputs>

    def test_collectOutputs(self):
        """
        Outputs can be combined with the "collector" argument to "upon".
        """
        import operator
        class Machine(object):
            m = MethodicalMachine()
            @m.input()
            def input(self):
                "an input"
            @m.output()
            def outputA(self):
                return "A"
            @m.output()
            def outputB(self):
                return "B"
            @m.state(initial=True)
            def state(self):
                "a state"
            state.upon(input, state, [outputA, outputB],
                       collector=lambda x: reduce(operator.add, x))
        m = Machine()
>       self.assertEqual(m.input(), "AB")

automat/_test/test_methodical.py:171: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
automat/_methodical.py:232: in __get__
    @preserveName(self.method)
automat/_introspection.py:43: in decorator
    return copyfunction(decorated,
automat/_introspection.py:35: in copyfunction
    return function(copycode(template.__code__, codechanges), *values)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = <code object doInput at 0x7f184dce8030, file "/builddir/build/BUILD/Automat-20.2.0/automat/_methodical.py", line 232>
changes = {'name': 'input'}

    def copycode(template, changes):
        names = [
            "argcount", "nlocals", "stacksize", "flags", "code", "consts",
            "names", "varnames", "filename", "name", "firstlineno", "lnotab",
            "freevars", "cellvars"
        ]
        if hasattr(code, "co_kwonlyargcount"):
            names.insert(1, "kwonlyargcount")
        if hasattr(code, "co_posonlyargcount"):
            # PEP 570 added "positional only arguments"
            names.insert(1, "posonlyargcount")
        values = [
            changes.get(name, getattr(template, "co_" + name))
            for name in names
        ]
>       return code(*values)
E       TypeError: code expected at least 18 arguments, got 16

automat/_introspection.py:23: TypeError
________________ MethodicalTests.test_inputFunctionsMustBeEmpty ________________

self = <automat._test.test_methodical.MethodicalTests testMethod=test_inputFunctionsMustBeEmpty>

    def test_inputFunctionsMustBeEmpty(self):
        """
        The wrapped input function must have an empty body.
        """
        # input functions are executed to assert that the signature matches,
        # but their body must be empty
    
        _methodical._empty() # chase coverage
        _methodical._docstring()
    
        class Mechanism(object):
            m = MethodicalMachine()
            with self.assertRaises(ValueError) as cm:
                @m.input()
                def input(self):
                    "an input"
                    list() # pragma: no cover
            self.assertEqual(str(cm.exception), "function body must be empty")
    
        # all three of these cases should be valid. Functions/methods with
        # docstrings produce slightly different bytecode than ones without.
    
        class MechanismWithDocstring(object):
            m = MethodicalMachine()
            @m.input()
            def input(self):
                "an input"
            @m.state(initial=True)
            def start(self):
                "starting state"
            start.upon(input, enter=start, outputs=[])
>       MechanismWithDocstring().input()

automat/_test/test_methodical.py:294: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
automat/_methodical.py:232: in __get__
    @preserveName(self.method)
automat/_introspection.py:43: in decorator
    return copyfunction(decorated,
automat/_introspection.py:35: in copyfunction
    return function(copycode(template.__code__, codechanges), *values)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = <code object doInput at 0x7f184dce8030, file "/builddir/build/BUILD/Automat-20.2.0/automat/_methodical.py", line 232>
changes = {'name': 'input'}

    def copycode(template, changes):
        names = [
            "argcount", "nlocals", "stacksize", "flags", "code", "consts",
            "names", "varnames", "filename", "name", "firstlineno", "lnotab",
            "freevars", "cellvars"
        ]
        if hasattr(code, "co_kwonlyargcount"):
            names.insert(1, "kwonlyargcount")
        if hasattr(code, "co_posonlyargcount"):
            # PEP 570 added "positional only arguments"
            names.insert(1, "posonlyargcount")
        values = [
            changes.get(name, getattr(template, "co_" + name))
            for name in names
        ]
>       return code(*values)
E       TypeError: code expected at least 18 arguments, got 16

automat/_introspection.py:23: TypeError
___________________ MethodicalTests.test_inputWithArguments ____________________

self = <automat._test.test_methodical.MethodicalTests testMethod=test_inputWithArguments>

    def test_inputWithArguments(self):
        """
        If an input takes an argument, it will pass that along to its output.
        """
        class Mechanism(object):
            m = MethodicalMachine()
            @m.input()
            def input(self, x, y=1):
                "an input"
            @m.state(initial=True)
            def state(self):
                "a state"
            @m.output()
            def output(self, x, y=1):
                self._x = x
                return x + y
            state.upon(input, state, [output])
    
        m = Mechanism()
>       self.assertEqual(m.input(3), [4])

automat/_test/test_methodical.py:211: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
automat/_methodical.py:232: in __get__
    @preserveName(self.method)
automat/_introspection.py:43: in decorator
    return copyfunction(decorated,
automat/_introspection.py:35: in copyfunction
    return function(copycode(template.__code__, codechanges), *values)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = <code object doInput at 0x7f184dce8030, file "/builddir/build/BUILD/Automat-20.2.0/automat/_methodical.py", line 232>
changes = {'name': 'input'}

    def copycode(template, changes):
        names = [
            "argcount", "nlocals", "stacksize", "flags", "code", "consts",
            "names", "varnames", "filename", "name", "firstlineno", "lnotab",
            "freevars", "cellvars"
        ]
        if hasattr(code, "co_kwonlyargcount"):
            names.insert(1, "kwonlyargcount")
        if hasattr(code, "co_posonlyargcount"):
            # PEP 570 added "positional only arguments"
            names.insert(1, "posonlyargcount")
        values = [
            changes.get(name, getattr(template, "co_" + name))
            for name in names
        ]
>       return code(*values)
E       TypeError: code expected at least 18 arguments, got 16

automat/_introspection.py:23: TypeError
_______________________ MethodicalTests.test_methodName ________________________

self = <automat._test.test_methodical.MethodicalTests testMethod=test_methodName>

    def test_methodName(self):
        """
        Input methods preserve their declared names.
        """
        class Mech(object):
            m = MethodicalMachine()
            @m.input()
            def declaredInputName(self):
                "an input"
            @m.state(initial=True)
            def aState(self):
                "state"
        m = Mech()
        with self.assertRaises(TypeError) as cm:
            m.declaredInputName("too", "many", "arguments")
>       self.assertIn("declaredInputName", str(cm.exception))
E       AssertionError: 'declaredInputName' not found in 'code expected at least 18 arguments, got 16'

automat/_test/test_methodical.py:189: AssertionError
____________________ MethodicalTests.test_multipleMachines _____________________

self = <automat._test.test_methodical.MethodicalTests testMethod=test_multipleMachines>

    def test_multipleMachines(self):
        """
        Two machines may co-exist happily on the same instance; they don't
        interfere with each other.
        """
        class MultiMach(object):
            a = MethodicalMachine()
            b = MethodicalMachine()
    
            @a.input()
            def inputA(self):
                "input A"
            @b.input()
            def inputB(self):
                "input B"
            @a.state(initial=True)
            def initialA(self):
                "initial A"
            @b.state(initial=True)
            def initialB(self):
                "initial B"
            @a.output()
            def outputA(self):
                return "A"
            @b.output()
            def outputB(self):
                return "B"
            initialA.upon(inputA, initialA, [outputA])
            initialB.upon(inputB, initialB, [outputB])
    
        mm = MultiMach()
>       self.assertEqual(mm.inputA(), ["A"])

automat/_test/test_methodical.py:145: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
automat/_methodical.py:232: in __get__
    @preserveName(self.method)
automat/_introspection.py:43: in decorator
    return copyfunction(decorated,
automat/_introspection.py:35: in copyfunction
    return function(copycode(template.__code__, codechanges), *values)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = <code object doInput at 0x7f184dce8030, file "/builddir/build/BUILD/Automat-20.2.0/automat/_methodical.py", line 232>
changes = {'name': 'inputA'}

    def copycode(template, changes):
        names = [
            "argcount", "nlocals", "stacksize", "flags", "code", "consts",
            "names", "varnames", "filename", "name", "firstlineno", "lnotab",
            "freevars", "cellvars"
        ]
        if hasattr(code, "co_kwonlyargcount"):
            names.insert(1, "kwonlyargcount")
        if hasattr(code, "co_posonlyargcount"):
            # PEP 570 added "positional only arguments"
            names.insert(1, "posonlyargcount")
        values = [
            changes.get(name, getattr(template, "co_" + name))
            for name in names
        ]
>       return code(*values)
E       TypeError: code expected at least 18 arguments, got 16

automat/_introspection.py:23: TypeError
______________________ MethodicalTests.test_oneTransition ______________________

self = <automat._test.test_methodical.MethodicalTests testMethod=test_oneTransition>

    def test_oneTransition(self):
        """
        L{MethodicalMachine} provides a way for you to declare a state machine
        with inputs, outputs, and states as methods.  When you have declared an
        input, an output, and a state, calling the input method in that state
        will produce the specified output.
        """
    
        class Machination(object):
            machine = MethodicalMachine()
            @machine.input()
            def anInput(self):
                "an input"
    
            @machine.output()
            def anOutput(self):
                "an output"
                return "an-output-value"
    
            @machine.output()
            def anotherOutput(self):
                "another output"
                return "another-output-value"
    
            @machine.state(initial=True)
            def anState(self):
                "a state"
    
            @machine.state()
            def anotherState(self):
                "another state"
    
            anState.upon(anInput, enter=anotherState, outputs=[anOutput])
            anotherState.upon(anInput, enter=anotherState,
                              outputs=[anotherOutput])
    
        m = Machination()
>       self.assertEqual(m.anInput(), ["an-output-value"])

automat/_test/test_methodical.py:56: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
automat/_methodical.py:232: in __get__
    @preserveName(self.method)
automat/_introspection.py:43: in decorator
    return copyfunction(decorated,
automat/_introspection.py:35: in copyfunction
    return function(copycode(template.__code__, codechanges), *values)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = <code object doInput at 0x7f184dce8030, file "/builddir/build/BUILD/Automat-20.2.0/automat/_methodical.py", line 232>
changes = {'name': 'anInput'}

    def copycode(template, changes):
        names = [
            "argcount", "nlocals", "stacksize", "flags", "code", "consts",
            "names", "varnames", "filename", "name", "firstlineno", "lnotab",
            "freevars", "cellvars"
        ]
        if hasattr(code, "co_kwonlyargcount"):
            names.insert(1, "kwonlyargcount")
        if hasattr(code, "co_posonlyargcount"):
            # PEP 570 added "positional only arguments"
            names.insert(1, "posonlyargcount")
        values = [
            changes.get(name, getattr(template, "co_" + name))
            for name in names
        ]
>       return code(*values)
E       TypeError: code expected at least 18 arguments, got 16

automat/_introspection.py:23: TypeError
_______________ MethodicalTests.test_outputWithSubsetOfArguments _______________

self = <automat._test.test_methodical.MethodicalTests testMethod=test_outputWithSubsetOfArguments>

    def test_outputWithSubsetOfArguments(self):
        """
        Inputs pass arguments that output will accept.
        """
        class Mechanism(object):
            m = MethodicalMachine()
            @m.input()
            def input(self, x, y=1):
                "an input"
            @m.state(initial=True)
            def state(self):
                "a state"
            @m.output()
            def outputX(self, x):
                self._x = x
                return x
            @m.output()
            def outputY(self, y):
                self._y = y
                return y
            @m.output()
            def outputNoArgs(self):
                return None
            state.upon(input, state, [outputX, outputY, outputNoArgs])
    
        m = Mechanism()
    
        # Pass x as positional argument.
>       self.assertEqual(m.input(3), [3, 1, None])

automat/_test/test_methodical.py:243: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
automat/_methodical.py:232: in __get__
    @preserveName(self.method)
automat/_introspection.py:43: in decorator
    return copyfunction(decorated,
automat/_introspection.py:35: in copyfunction
    return function(copycode(template.__code__, codechanges), *values)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = <code object doInput at 0x7f184dce8030, file "/builddir/build/BUILD/Automat-20.2.0/automat/_methodical.py", line 232>
changes = {'name': 'input'}

    def copycode(template, changes):
        names = [
            "argcount", "nlocals", "stacksize", "flags", "code", "consts",
            "names", "varnames", "filename", "name", "firstlineno", "lnotab",
            "freevars", "cellvars"
        ]
        if hasattr(code, "co_kwonlyargcount"):
            names.insert(1, "kwonlyargcount")
        if hasattr(code, "co_posonlyargcount"):
            # PEP 570 added "positional only arguments"
            names.insert(1, "posonlyargcount")
        values = [
            changes.get(name, getattr(template, "co_" + name))
            for name in names
        ]
>       return code(*values)
E       TypeError: code expected at least 18 arguments, got 16

automat/_introspection.py:23: TypeError
____________________ MethodicalTests.test_outputsArePrivate ____________________

self = <automat._test.test_methodical.MethodicalTests testMethod=test_outputsArePrivate>

    def test_outputsArePrivate(self):
        """
        One of the benefits of using a state machine is that your output method
        implementations don't need to take invalid state transitions into
        account - the methods simply won't be called.  This property would be
        broken if client code called output methods directly, so output methods
        are not directly visible under their names.
        """
        class Machination(object):
            machine = MethodicalMachine()
            counter = 0
            @machine.input()
            def anInput(self):
                "an input"
            @machine.output()
            def anOutput(self):
                self.counter += 1
            @machine.state(initial=True)
            def state(self):
                "a machine state"
            state.upon(anInput, enter=state, outputs=[anOutput])
        mach1 = Machination()
>       mach1.anInput()

automat/_test/test_methodical.py:100: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
automat/_methodical.py:232: in __get__
    @preserveName(self.method)
automat/_introspection.py:43: in decorator
    return copyfunction(decorated,
automat/_introspection.py:35: in copyfunction
    return function(copycode(template.__code__, codechanges), *values)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = <code object doInput at 0x7f184dce8030, file "/builddir/build/BUILD/Automat-20.2.0/automat/_methodical.py", line 232>
changes = {'name': 'anInput'}

    def copycode(template, changes):
        names = [
            "argcount", "nlocals", "stacksize", "flags", "code", "consts",
            "names", "varnames", "filename", "name", "firstlineno", "lnotab",
            "freevars", "cellvars"
        ]
        if hasattr(code, "co_kwonlyargcount"):
            names.insert(1, "kwonlyargcount")
        if hasattr(code, "co_posonlyargcount"):
            # PEP 570 added "positional only arguments"
            names.insert(1, "posonlyargcount")
        values = [
            changes.get(name, getattr(template, "co_" + name))
            for name in names
        ]
>       return code(*values)
E       TypeError: code expected at least 18 arguments, got 16

automat/_introspection.py:23: TypeError
______________________ MethodicalTests.test_restoreState _______________________

self = <automat._test.test_methodical.MethodicalTests testMethod=test_restoreState>

    def test_restoreState(self):
        """
        L{MethodicalMachine.unserializer} decorates a function that becomes a
        machine-state unserializer; its return value is mapped to the
        C{serialized} parameter to C{state}, and the L{MethodicalMachine}
        associated with that instance's state is updated to that state.
        """
    
        class Mechanism(object):
            m = MethodicalMachine()
            def __init__(self):
                self.value = 1
                self.ranOutput = False
            @m.state(serialized="first-state", initial=True)
            def first(self):
                "First state."
            @m.state(serialized="second-state")
            def second(self):
                "Second state."
            @m.input()
            def input(self):
                "an input"
            @m.output()
            def output(self):
                self.value = 2
                self.ranOutput = True
                return 1
            @m.output()
            def output2(self):
                return 2
            first.upon(input, second, [output],
                       collector=lambda x: list(x)[0])
            second.upon(input, second, [output2],
                        collector=lambda x: list(x)[0])
            @m.serializer()
            def save(self, state):
                return {
                    'machine-state': state,
                    'some-value': self.value,
                }
    
            @m.unserializer()
            def _restore(self, blob):
                self.value = blob['some-value']
                return blob['machine-state']
    
            @classmethod
            def fromBlob(cls, blob):
                self = cls()
                self._restore(blob)
                return self
    
        m1 = Mechanism()
>       m1.input()

automat/_test/test_methodical.py:563: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
automat/_methodical.py:232: in __get__
    @preserveName(self.method)
automat/_introspection.py:43: in decorator
    return copyfunction(decorated,
automat/_introspection.py:35: in copyfunction
    return function(copycode(template.__code__, codechanges), *values)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = <code object doInput at 0x7f184dce8030, file "/builddir/build/BUILD/Automat-20.2.0/automat/_methodical.py", line 232>
changes = {'name': 'input'}

    def copycode(template, changes):
        names = [
            "argcount", "nlocals", "stacksize", "flags", "code", "consts",
            "names", "varnames", "filename", "name", "firstlineno", "lnotab",
            "freevars", "cellvars"
        ]
        if hasattr(code, "co_kwonlyargcount"):
            names.insert(1, "kwonlyargcount")
        if hasattr(code, "co_posonlyargcount"):
            # PEP 570 added "positional only arguments"
            names.insert(1, "posonlyargcount")
        values = [
            changes.get(name, getattr(template, "co_" + name))
            for name in names
        ]
>       return code(*values)
E       TypeError: code expected at least 18 arguments, got 16

automat/_introspection.py:23: TypeError
______________________ TraceTests.test_inputs_and_outputs ______________________

self = <automat._test.test_trace.TraceTests testMethod=test_inputs_and_outputs>

    def test_inputs_and_outputs(self):
        traces = []
        def tracer(old_state, input, new_state):
            traces.append((old_state, input, new_state, None))
            def trace_outputs(output):
                traces.append((old_state, input, new_state, output))
            return trace_outputs # "I care about outputs too"
        s = SampleObject()
        s.setTrace(tracer)
    
>       s.go1()

automat/_test/test_trace.py:75: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
automat/_methodical.py:232: in __get__
    @preserveName(self.method)
automat/_introspection.py:43: in decorator
    return copyfunction(decorated,
automat/_introspection.py:35: in copyfunction
    return function(copycode(template.__code__, codechanges), *values)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = <code object doInput at 0x7f184dce8030, file "/builddir/build/BUILD/Automat-20.2.0/automat/_methodical.py", line 232>
changes = {'name': 'go1'}

    def copycode(template, changes):
        names = [
            "argcount", "nlocals", "stacksize", "flags", "code", "consts",
            "names", "varnames", "filename", "name", "firstlineno", "lnotab",
            "freevars", "cellvars"
        ]
        if hasattr(code, "co_kwonlyargcount"):
            names.insert(1, "kwonlyargcount")
        if hasattr(code, "co_posonlyargcount"):
            # PEP 570 added "positional only arguments"
            names.insert(1, "posonlyargcount")
        values = [
            changes.get(name, getattr(template, "co_" + name))
            for name in names
        ]
>       return code(*values)
E       TypeError: code expected at least 18 arguments, got 16

automat/_introspection.py:23: TypeError
_________________________ TraceTests.test_only_inputs __________________________

self = <automat._test.test_trace.TraceTests testMethod=test_only_inputs>

    def test_only_inputs(self):
        traces = []
        def tracer(old_state, input, new_state):
            traces.append((old_state, input, new_state))
            return None # "I only care about inputs, not outputs"
        s = SampleObject()
        s.setTrace(tracer)
    
>       s.go1()

automat/_test/test_trace.py:47: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
automat/_methodical.py:232: in __get__
    @preserveName(self.method)
automat/_introspection.py:43: in decorator
    return copyfunction(decorated,
automat/_introspection.py:35: in copyfunction
    return function(copycode(template.__code__, codechanges), *values)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = <code object doInput at 0x7f184dce8030, file "/builddir/build/BUILD/Automat-20.2.0/automat/_methodical.py", line 232>
changes = {'name': 'go1'}

    def copycode(template, changes):
        names = [
            "argcount", "nlocals", "stacksize", "flags", "code", "consts",
            "names", "varnames", "filename", "name", "firstlineno", "lnotab",
            "freevars", "cellvars"
        ]
        if hasattr(code, "co_kwonlyargcount"):
            names.insert(1, "kwonlyargcount")
        if hasattr(code, "co_posonlyargcount"):
            # PEP 570 added "positional only arguments"
            names.insert(1, "posonlyargcount")
        values = [
            changes.get(name, getattr(template, "co_" + name))
            for name in names
        ]
>       return code(*values)
E       TypeError: code expected at least 18 arguments, got 16

automat/_introspection.py:23: TypeError
_____________________ IntegrationTests.test_validGraphviz ______________________

self = <automat._test.test_visualize.IntegrationTests testMethod=test_validGraphviz>

    def test_validGraphviz(self):
        """
        L{graphviz} emits valid graphviz data.
        """
        p = subprocess.Popen("dot", stdin=subprocess.PIPE,
                             stdout=subprocess.PIPE)
>       out, err = p.communicate("".join(sampleMachine().asDigraph())
                                 .encode("utf-8"))

automat/_test/test_visualize.py:229: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
automat/_test/test_visualize.py:60: in sampleMachine
    so.go()
automat/_methodical.py:232: in __get__
    @preserveName(self.method)
automat/_introspection.py:43: in decorator
    return copyfunction(decorated,
automat/_introspection.py:35: in copyfunction
    return function(copycode(template.__code__, codechanges), *values)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = <code object doInput at 0x7f184dce8030, file "/builddir/build/BUILD/Automat-20.2.0/automat/_methodical.py", line 232>
changes = {'name': 'go'}

    def copycode(template, changes):
        names = [
            "argcount", "nlocals", "stacksize", "flags", "code", "consts",
            "names", "varnames", "filename", "name", "firstlineno", "lnotab",
            "freevars", "cellvars"
        ]
        if hasattr(code, "co_kwonlyargcount"):
            names.insert(1, "kwonlyargcount")
        if hasattr(code, "co_posonlyargcount"):
            # PEP 570 added "positional only arguments"
            names.insert(1, "posonlyargcount")
        values = [
            changes.get(name, getattr(template, "co_" + name))
            for name in names
        ]
>       return code(*values)
E       TypeError: code expected at least 18 arguments, got 16

automat/_introspection.py:23: TypeError
___________________ SpotChecks.test_containsMachineFeatures ____________________

self = <automat._test.test_visualize.SpotChecks testMethod=test_containsMachineFeatures>

    def test_containsMachineFeatures(self):
        """
        The output of L{graphviz} should contain the names of the states,
        inputs, outputs in the state machine.
        """
>       gvout = "".join(sampleMachine().asDigraph())

automat/_test/test_visualize.py:246: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
automat/_test/test_visualize.py:60: in sampleMachine
    so.go()
automat/_methodical.py:232: in __get__
    @preserveName(self.method)
automat/_introspection.py:43: in decorator
    return copyfunction(decorated,
automat/_introspection.py:35: in copyfunction
    return function(copycode(template.__code__, codechanges), *values)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = <code object doInput at 0x7f184dce8030, file "/builddir/build/BUILD/Automat-20.2.0/automat/_methodical.py", line 232>
changes = {'name': 'go'}

    def copycode(template, changes):
        names = [
            "argcount", "nlocals", "stacksize", "flags", "code", "consts",
            "names", "varnames", "filename", "name", "firstlineno", "lnotab",
            "freevars", "cellvars"
        ]
        if hasattr(code, "co_kwonlyargcount"):
            names.insert(1, "kwonlyargcount")
        if hasattr(code, "co_posonlyargcount"):
            # PEP 570 added "positional only arguments"
            names.insert(1, "posonlyargcount")
        values = [
            changes.get(name, getattr(template, "co_" + name))
            for name in names
        ]
>       return code(*values)
E       TypeError: code expected at least 18 arguments, got 16

automat/_introspection.py:23: TypeError
=========================== short test summary info ============================
FAILED automat/_test/test_methodical.py::MethodicalTests::test_badTransitionForCurrentState
FAILED automat/_test/test_methodical.py::MethodicalTests::test_collectOutputs
FAILED automat/_test/test_methodical.py::MethodicalTests::test_inputFunctionsMustBeEmpty
FAILED automat/_test/test_methodical.py::MethodicalTests::test_inputWithArguments
FAILED automat/_test/test_methodical.py::MethodicalTests::test_methodName - A...
FAILED automat/_test/test_methodical.py::MethodicalTests::test_multipleMachines
FAILED automat/_test/test_methodical.py::MethodicalTests::test_oneTransition
FAILED automat/_test/test_methodical.py::MethodicalTests::test_outputWithSubsetOfArguments
FAILED automat/_test/test_methodical.py::MethodicalTests::test_outputsArePrivate
FAILED automat/_test/test_methodical.py::MethodicalTests::test_restoreState
FAILED automat/_test/test_trace.py::TraceTests::test_inputs_and_outputs - Typ...
FAILED automat/_test/test_trace.py::TraceTests::test_only_inputs - TypeError:...
FAILED automat/_test/test_visualize.py::IntegrationTests::test_validGraphviz
FAILED automat/_test/test_visualize.py::SpotChecks::test_containsMachineFeatures
======================== 14 failed, 47 passed in 0.48s =========================

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/03269797-python-Automat/

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

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 Ben Cotton 2022-02-08 20:18:29 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 2 Robert-André Mauchin 🐧 2022-02-14 02:53:02 UTC
https://github.com/glyph/automat/issues/135

Comment 3 Fedora Update System 2022-02-14 23:32:33 UTC
FEDORA-2022-dcd15e28a7 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-dcd15e28a7

Comment 4 Fedora Update System 2022-02-14 23:35:13 UTC
FEDORA-2022-dcd15e28a7 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 5 Fedora Update System 2022-02-15 00:17:02 UTC
FEDORA-2022-a178df41ac has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-a178df41ac

Comment 6 Fedora Update System 2022-02-15 00:23:14 UTC
FEDORA-2022-a178df41ac has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.


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