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

python 3.14.0a1 - test_partial and test_smart_decorator are failing #1480

Open
hrnciar opened this issue Oct 25, 2024 · 4 comments · May be fixed by #1483
Open

python 3.14.0a1 - test_partial and test_smart_decorator are failing #1480

hrnciar opened this issue Oct 25, 2024 · 4 comments · May be fixed by #1483

Comments

@hrnciar
Copy link

hrnciar commented Oct 25, 2024

Describe the bug

Fedora is starting to rebuild packages with upcoming python 3.14. Some tests are failing.

======================================================================
ERROR: test_partial (tests.test_trees.TestTrees.test_partial)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-lark-1.2.2-build/lark-1.2.2/lark/visitors.py", line 122, in _call_userfunc
    return f.visit_wrapper(f, tree.data, children, tree.meta)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/python-lark-1.2.2-build/lark-1.2.2/lark/visitors.py", line 504, in _vargs_inline
    return f(*children)
  File "/builddir/build/BUILD/python-lark-1.2.2-build/lark-1.2.2/lark/visitors.py", line 482, in __call__
    return self.base_func(*args, **kwargs)
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
TypeError: TestTrees.test_partial.<locals>.test() got multiple values for argument 'postfix'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/builddir/build/BUILD/python-lark-1.2.2-build/lark-1.2.2/tests/test_trees.py", line 361, in test_partial
    res = T().transform(tree)
  File "/builddir/build/BUILD/python-lark-1.2.2-build/lark-1.2.2/lark/visitors.py", line 161, in transform
    res = list(self._transform_children([tree]))
  File "/builddir/build/BUILD/python-lark-1.2.2-build/lark-1.2.2/lark/visitors.py", line 146, in _transform_children
    res = self._transform_tree(c)
  File "/builddir/build/BUILD/python-lark-1.2.2-build/lark-1.2.2/lark/visitors.py", line 156, in _transform_tree
    children = list(self._transform_children(tree.children))
  File "/builddir/build/BUILD/python-lark-1.2.2-build/lark-1.2.2/lark/visitors.py", line 146, in _transform_children
    res = self._transform_tree(c)
  File "/builddir/build/BUILD/python-lark-1.2.2-build/lark-1.2.2/lark/visitors.py", line 157, in _transform_tree
    return self._call_userfunc(tree, children)
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/python-lark-1.2.2-build/lark-1.2.2/lark/visitors.py", line 128, in _call_userfunc
    raise VisitError(tree.data, tree, e)
lark.exceptions.VisitError: Error trying to process rule "a":

TestTrees.test_partial.<locals>.test() got multiple values for argument 'postfix'

======================================================================
ERROR: test_smart_decorator (tests.test_trees.TestTrees.test_smart_decorator)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-lark-1.2.2-build/lark-1.2.2/lark/visitors.py", line 122, in _call_userfunc
    return f.visit_wrapper(f, tree.data, children, tree.meta)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/python-lark-1.2.2-build/lark-1.2.2/lark/visitors.py", line 504, in _vargs_inline
    return f(*children)
  File "/builddir/build/BUILD/python-lark-1.2.2-build/lark-1.2.2/lark/visitors.py", line 482, in __call__
    return self.base_func(*args, **kwargs)
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
TypeError: reduce() arg 2 must support iteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/builddir/build/BUILD/python-lark-1.2.2-build/lark-1.2.2/tests/test_trees.py", line 293, in test_smart_decorator
    result = test_instance.transform(Tree(method_name, children))
  File "/builddir/build/BUILD/python-lark-1.2.2-build/lark-1.2.2/lark/visitors.py", line 161, in transform
    res = list(self._transform_children([tree]))
  File "/builddir/build/BUILD/python-lark-1.2.2-build/lark-1.2.2/lark/visitors.py", line 146, in _transform_children
    res = self._transform_tree(c)
  File "/builddir/build/BUILD/python-lark-1.2.2-build/lark-1.2.2/lark/visitors.py", line 157, in _transform_tree
    return self._call_userfunc(tree, children)
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/python-lark-1.2.2-build/lark-1.2.2/lark/visitors.py", line 128, in _call_userfunc
    raise VisitError(tree.data, tree, e)
lark.exceptions.VisitError: Error trying to process rule "partial_reduce_mul":

reduce() arg 2 must support iteration

----------------------------------------------------------------------
Ran 1115 tests in 8.042s

FAILED (errors=2, skipped=131)
@MegaIng
Copy link
Member

MegaIng commented Oct 25, 2024

This means that partial change it's interface in some way in case someone else wants to dig up what exactly it is in the python changelog.

Since Python3.14 is still in the alpha phase, this might also be a bug/unintended breaking change on their side.

@hroncok
Copy link

hroncok commented Oct 25, 2024

python/cpython#121089 Make the functools.partial object a method descriptor.

This sounds possibly related.

@MegaIng
Copy link
Member

MegaIng commented Oct 25, 2024

Yeah, also found that.

So CPython is performing a breaking change with no deprecation warnings and less than 1 version FutureWarning :-/

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

Successfully merging a pull request may close this issue.

5 participants
@hroncok @hrnciar @MegaIng and others