Bug 1714214 - python-Automat fails to build with Python 3.8
Summary: python-Automat fails to build with Python 3.8
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-Automat
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Robert-André Mauchin 🐧
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON38
TreeView+ depends on / blocked
 
Reported: 2019-05-27 11:53 UTC by Miro Hrončok
Modified: 2019-05-27 19:45 UTC (History)
3 users (show)

Fixed In Version: python-Automat-0.7.0-3.fc31
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-27 19:45:45 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Full log from Copr (224.40 KB, text/plain)
2019-05-27 11:53 UTC, Miro Hrončok
no flags Details

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


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