Bug 1714214

Summary: python-Automat fails to build with Python 3.8
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: python-AutomatAssignee: Robert-André Mauchin 🐧 <zebob.m>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: carl, python-sig, zebob.m
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-Automat-0.7.0-3.fc31 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-27 19:45:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1686977    
Attachments:
Description Flags
Full log from Copr none

Description Miro Hrončok 2019-05-27 11:53:04 UTC
Created attachment 1573893 [details]
Full log from Copr

python-Automat 0.7.0-2.fc31 fails to build with Python 3.8.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:234: in __get__
    def doInput(*args, **kwargs):
automat/_introspection.py:40: in decorator
    return copyfunction(decorated,
automat/_introspection.py:32: 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")
        values = [
            changes.get(name, getattr(template, "co_" + name))
            for name in names
        ]
>       return code(*values)
E       TypeError: an integer is required (got type bytes)

automat/_introspection.py:20: TypeError


(and several similar ones, full log attached)



Fixes in other projects:

https://github.com/HypothesisWorks/hypothesis/commit/8f47297fa2e19c426a42b06bb5f8bf1406b8f0f3#diff-a097452b8ffe8323641ccccac335fbf9
https://github.com/ipython/ipython/commit/248128dfaabb33e922b1e36a298fd7ec0c730069
https://github.com/edgewall/genshi/pull/19

Comment 1 Robert-André Mauchin 🐧 2019-05-27 19:16:56 UTC
Consequences of PEP570 again. I'll see if I car try the genshi fix.

Comment 2 Robert-André Mauchin 🐧 2019-05-27 19:45:45 UTC
Fixed in python-Automat-0.7.0-3.fc31.
Tested w/ the Python 3.8 COPR.

Upstreamed the fix here: https://github.com/glyph/automat/pull/111