question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python 3.9 test failures on 0.29.x

See original GitHub issue

Hello. In Fedora, we try to build our packages with pre-releases of Python 3.9. Cython seem to work fine in general cases, but there are some test failures with Cython 0.29.15 and Python 3.9.0a3.

I haven’t found any issue for this, so I’m opening this one to track it. I know that sometimes the master branch has such problems fixed and if pointed to them, we can work on backports.

Here is the full log: build.log

And here are the failures:

======================================================================
FAIL: A (always_allow_keywords_T295)
Doctest: always_allow_keywords_T295.A
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.9/doctest.py", line 2197, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for always_allow_keywords_T295.A
  File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/1/run/c/always_allow_keywords_T295/always_allow_keywords_T295.cpython-39-x86_64-linux-gnu.so", line unknown line number, in A
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/1/run/c/always_allow_keywords_T295/always_allow_keywords_T295.cpython-39-x86_64-linux-gnu.so", line ?, in always_allow_keywords_T295.A
Failed example:
    A().meth1(arg=None)
Expected:
    Traceback (most recent call last):
    ...
    TypeError: meth1() takes no keyword arguments
Got:
    Traceback (most recent call last):
      File "/usr/lib64/python3.9/doctest.py", line 1329, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest always_allow_keywords_T295.A[2]>", line 1, in <module>
        A().meth1(arg=None)
    TypeError: A.meth1() takes no keyword arguments
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/1/run/c/always_allow_keywords_T295/always_allow_keywords_T295.cpython-39-x86_64-linux-gnu.so", line ?, in always_allow_keywords_T295.A
Failed example:
    A().meth2(arg=None)
Expected:
    Traceback (most recent call last):
    ...
    TypeError: meth2() takes no keyword arguments
Got:
    Traceback (most recent call last):
      File "/usr/lib64/python3.9/doctest.py", line 1329, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest always_allow_keywords_T295.A[5]>", line 1, in <module>
        A().meth2(arg=None)
    TypeError: A.meth2() takes no keyword arguments
======================================================================
FAIL: func1 (always_allow_keywords_T295)
Doctest: always_allow_keywords_T295.func1
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.9/doctest.py", line 2197, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for always_allow_keywords_T295.func1
  File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/1/run/c/always_allow_keywords_T295/always_allow_keywords_T295.cpython-39-x86_64-linux-gnu.so", line unknown line number, in func1
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/1/run/c/always_allow_keywords_T295/always_allow_keywords_T295.cpython-39-x86_64-linux-gnu.so", line ?, in always_allow_keywords_T295.func1
Failed example:
    func1(arg=None)
Expected:
    Traceback (most recent call last):
    ...
    TypeError: func1() takes no keyword arguments
Got:
    Traceback (most recent call last):
      File "/usr/lib64/python3.9/doctest.py", line 1329, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest always_allow_keywords_T295.func1[2]>", line 1, in <module>
        func1(arg=None)
    TypeError: always_allow_keywords_T295.func1() takes no keyword arguments
======================================================================
FAIL: func2 (always_allow_keywords_T295)
Doctest: always_allow_keywords_T295.func2
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.9/doctest.py", line 2197, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for always_allow_keywords_T295.func2
  File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/1/run/c/always_allow_keywords_T295/always_allow_keywords_T295.cpython-39-x86_64-linux-gnu.so", line unknown line number, in func2
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/1/run/c/always_allow_keywords_T295/always_allow_keywords_T295.cpython-39-x86_64-linux-gnu.so", line ?, in always_allow_keywords_T295.func2
Failed example:
    func2(arg=None)
Expected:
    Traceback (most recent call last):
    ...
    TypeError: func2() takes no keyword arguments
Got:
    Traceback (most recent call last):
      File "/usr/lib64/python3.9/doctest.py", line 1329, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest always_allow_keywords_T295.func2[2]>", line 1, in <module>
        func2(arg=None)
    TypeError: always_allow_keywords_T295.func2() takes no keyword arguments
======================================================================
FAIL: A (always_allow_keywords_T295)
Doctest: always_allow_keywords_T295.A
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.9/doctest.py", line 2197, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for always_allow_keywords_T295.A
  File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/1/run/cpp/always_allow_keywords_T295/always_allow_keywords_T295.cpython-39-x86_64-linux-gnu.so", line unknown line number, in A
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/1/run/cpp/always_allow_keywords_T295/always_allow_keywords_T295.cpython-39-x86_64-linux-gnu.so", line ?, in always_allow_keywords_T295.A
Failed example:
    A().meth1(arg=None)
Expected:
    Traceback (most recent call last):
    ...
    TypeError: meth1() takes no keyword arguments
Got:
    Traceback (most recent call last):
      File "/usr/lib64/python3.9/doctest.py", line 1329, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest always_allow_keywords_T295.A[2]>", line 1, in <module>
        A().meth1(arg=None)
    TypeError: A.meth1() takes no keyword arguments
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/1/run/cpp/always_allow_keywords_T295/always_allow_keywords_T295.cpython-39-x86_64-linux-gnu.so", line ?, in always_allow_keywords_T295.A
Failed example:
    A().meth2(arg=None)
Expected:
    Traceback (most recent call last):
    ...
    TypeError: meth2() takes no keyword arguments
Got:
    Traceback (most recent call last):
      File "/usr/lib64/python3.9/doctest.py", line 1329, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest always_allow_keywords_T295.A[5]>", line 1, in <module>
        A().meth2(arg=None)
    TypeError: A.meth2() takes no keyword arguments
======================================================================
FAIL: func1 (always_allow_keywords_T295)
Doctest: always_allow_keywords_T295.func1
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.9/doctest.py", line 2197, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for always_allow_keywords_T295.func1
  File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/1/run/cpp/always_allow_keywords_T295/always_allow_keywords_T295.cpython-39-x86_64-linux-gnu.so", line unknown line number, in func1
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/1/run/cpp/always_allow_keywords_T295/always_allow_keywords_T295.cpython-39-x86_64-linux-gnu.so", line ?, in always_allow_keywords_T295.func1
Failed example:
    func1(arg=None)
Expected:
    Traceback (most recent call last):
    ...
    TypeError: func1() takes no keyword arguments
Got:
    Traceback (most recent call last):
      File "/usr/lib64/python3.9/doctest.py", line 1329, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest always_allow_keywords_T295.func1[2]>", line 1, in <module>
        func1(arg=None)
    TypeError: always_allow_keywords_T295.func1() takes no keyword arguments
======================================================================
FAIL: func2 (always_allow_keywords_T295)
Doctest: always_allow_keywords_T295.func2
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.9/doctest.py", line 2197, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for always_allow_keywords_T295.func2
  File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/1/run/cpp/always_allow_keywords_T295/always_allow_keywords_T295.cpython-39-x86_64-linux-gnu.so", line unknown line number, in func2
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/1/run/cpp/always_allow_keywords_T295/always_allow_keywords_T295.cpython-39-x86_64-linux-gnu.so", line ?, in always_allow_keywords_T295.func2
Failed example:
    func2(arg=None)
Expected:
    Traceback (most recent call last):
    ...
    TypeError: func2() takes no keyword arguments
Got:
    Traceback (most recent call last):
      File "/usr/lib64/python3.9/doctest.py", line 1329, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest always_allow_keywords_T295.func2[2]>", line 1, in <module>
        func2(arg=None)
    TypeError: always_allow_keywords_T295.func2() takes no keyword arguments
======================================================================
FAIL: B (py3k_super)
Doctest: py3k_super.B
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.9/doctest.py", line 2197, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for py3k_super.B
  File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/1/run/c/py3k_super/py3k_super.cpython-39-x86_64-linux-gnu.so", line unknown line number, in B
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/1/run/c/py3k_super/py3k_super.cpython-39-x86_64-linux-gnu.so", line ?, in py3k_super.B
Failed example:
    B.class_method()
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib64/python3.9/doctest.py", line 1329, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest py3k_super.B[2]>", line 1, in <module>
        B.class_method()
      File "tests/run/py3k_super.pyx", line 37, in py3k_super.B.class_method
        return super().class_method()
    TypeError: super(type, obj): obj must be an instance or subtype of type
======================================================================
FAIL: B (py3k_super)
Doctest: py3k_super.B
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.9/doctest.py", line 2197, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for py3k_super.B
  File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/1/run/cpp/py3k_super/py3k_super.cpython-39-x86_64-linux-gnu.so", line unknown line number, in B
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/1/run/cpp/py3k_super/py3k_super.cpython-39-x86_64-linux-gnu.so", line ?, in py3k_super.B
Failed example:
    B.class_method()
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib64/python3.9/doctest.py", line 1329, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest py3k_super.B[2]>", line 1, in <module>
        B.class_method()
      File "tests/run/py3k_super.pyx", line 37, in py3k_super.B.class_method
        return super().class_method()
    TypeError: super(type, obj): obj must be an instance or subtype of type
----------------------------------------------------------------------
======================================================================
FAIL: staff (closure_class_T596)
Doctest: closure_class_T596.staff
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.9/doctest.py", line 2197, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for closure_class_T596.staff
  File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/5/run/c/closure_class_T596/closure_class_T596.cpython-39-x86_64-linux-gnu.so", line unknown line number, in staff
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/5/run/c/closure_class_T596/closure_class_T596.cpython-39-x86_64-linux-gnu.so", line ?, in closure_class_T596.staff
Failed example:
    kls.klass()
Expected:
    ('Foo', 1, 2)
Got:
    ('type', 1, 2)
======================================================================
FAIL: staff (closure_class_T596)
Doctest: closure_class_T596.staff
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.9/doctest.py", line 2197, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for closure_class_T596.staff
  File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/5/run/cpp/closure_class_T596/closure_class_T596.cpython-39-x86_64-linux-gnu.so", line unknown line number, in staff
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/5/run/cpp/closure_class_T596/closure_class_T596.cpython-39-x86_64-linux-gnu.so", line ?, in closure_class_T596.staff
Failed example:
    kls.klass()
Expected:
    ('Foo', 1, 2)
Got:
    ('type', 1, 2)
----------------------------------------------------------------------
======================================================================
FAIL: B (py2_super)
Doctest: py2_super.B
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.9/doctest.py", line 2197, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for py2_super.B
  File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/0/run/c/py2_super/py2_super.cpython-39-x86_64-linux-gnu.so", line unknown line number, in B
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/0/run/c/py2_super/py2_super.cpython-39-x86_64-linux-gnu.so", line ?, in py2_super.B
Failed example:
    B.class_method()
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib64/python3.9/doctest.py", line 1329, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest py2_super.B[2]>", line 1, in <module>
        B.class_method()
      File "tests/run/py2_super.pyx", line 37, in py2_super.B.class_method
        return super(B, cls).class_method()
    TypeError: super(type, obj): obj must be an instance or subtype of type
======================================================================
FAIL: B (py2_super)
Doctest: py2_super.B
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.9/doctest.py", line 2197, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for py2_super.B
  File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/0/run/cpp/py2_super/py2_super.cpython-39-x86_64-linux-gnu.so", line unknown line number, in B
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/0/run/cpp/py2_super/py2_super.cpython-39-x86_64-linux-gnu.so", line ?, in py2_super.B
Failed example:
    B.class_method()
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib64/python3.9/doctest.py", line 1329, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest py2_super.B[2]>", line 1, in <module>
        B.class_method()
      File "tests/run/py2_super.pyx", line 37, in py2_super.B.class_method
        return super(B, cls).class_method()
    TypeError: super(type, obj): obj must be an instance or subtype of type
----------------------------------------------------------------------
======================================================================
FAIL: classmethod ()
Doctest: classmethod
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.9/doctest.py", line 2197, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for classmethod
  File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/4/run/c/classmethod/classmethod.cpython-39-x86_64-linux-gnu.so", line 1, in classmethod
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/4/run/c/classmethod/classmethod.cpython-39-x86_64-linux-gnu.so", line 9, in classmethod
Failed example:
    class1.bview()
Expected:
    class1
Got:
    type
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/4/run/c/classmethod/classmethod.cpython-39-x86_64-linux-gnu.so", line 11, in classmethod
Failed example:
    class1().bview()
Expected:
    class1
Got:
    type
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/4/run/c/classmethod/classmethod.cpython-39-x86_64-linux-gnu.so", line 21, in classmethod
Failed example:
    class3.bview()
Expected:
    class3
Got:
    type
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/4/run/c/classmethod/classmethod.cpython-39-x86_64-linux-gnu.so", line 23, in classmethod
Failed example:
    class3().bview()
Expected:
    class3
Got:
    type
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/4/run/c/classmethod/classmethod.cpython-39-x86_64-linux-gnu.so", line 28, in classmethod
Failed example:
    class4.view()
Expected:
    class4
Got:
    type
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/4/run/c/classmethod/classmethod.cpython-39-x86_64-linux-gnu.so", line 30, in classmethod
Failed example:
    class5.view()
Expected:
    class5
Got:
    type
======================================================================
FAIL: classmethod ()
Doctest: classmethod
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.9/doctest.py", line 2197, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for classmethod
  File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/4/run/cpp/classmethod/classmethod.cpython-39-x86_64-linux-gnu.so", line 1, in classmethod
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/4/run/cpp/classmethod/classmethod.cpython-39-x86_64-linux-gnu.so", line 9, in classmethod
Failed example:
    class1.bview()
Expected:
    class1
Got:
    type
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/4/run/cpp/classmethod/classmethod.cpython-39-x86_64-linux-gnu.so", line 11, in classmethod
Failed example:
    class1().bview()
Expected:
    class1
Got:
    type
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/4/run/cpp/classmethod/classmethod.cpython-39-x86_64-linux-gnu.so", line 21, in classmethod
Failed example:
    class3.bview()
Expected:
    class3
Got:
    type
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/4/run/cpp/classmethod/classmethod.cpython-39-x86_64-linux-gnu.so", line 23, in classmethod
Failed example:
    class3().bview()
Expected:
    class3
Got:
    type
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/4/run/cpp/classmethod/classmethod.cpython-39-x86_64-linux-gnu.so", line 28, in classmethod
Failed example:
    class4.view()
Expected:
    class4
Got:
    type
----------------------------------------------------------------------
File "/builddir/build/BUILD/cython-0.29.15/TEST_TMP/4/run/cpp/classmethod/classmethod.cpython-39-x86_64-linux-gnu.so", line 30, in classmethod
Failed example:
    class5.view()
Expected:
    class5
Got:
    type
----------------------------------------------------------------------

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:31 (21 by maintainers)

github_iconTop GitHub Comments

1reaction
scodercommented, Jul 7, 2020

@hroncok could you test the latest 0.29.x (or release) branch?

It contains a somewhat questionable change that makes it generate different code on 16-bit Py2.x Unicode platforms (including Windows), and hopefully only there – that’s what I would like to be sure about.

1reaction
scodercommented, Feb 26, 2020

They came from #3106.

Read more comments on GitHub >

github_iconTop Results From Across the Web

1788506 – Cython fails to build with Python 3.9 with tests ...
Summary: Cython fails to build with Python 3.9 with tests enabled, classmethods are se... 0.29. x: Fix deprecated threading API usage in test...
Read more >
make test failures, 2 tests failed: test_embed test_tabnanny
I'm trying to install python 3.9.2 on a 18.04.5 ubuntu. ... I get this error : == Tests result: FAILURE then FAILURE ==...
Read more >
What's New In Python 3.9 — Python 3.11.1 documentation
More generally, try to run your tests in the Python Development Mode which helps to prepare your code to make it compatible with...
Read more >
Cython Changelog — Cython 3.0.0a11 documentation
Test patch by Kirill Smelkov. ... Improve compatibility between classes pickled in Cython 3.0 and 0.29.x by ... Deprecated import failed in Python...
Read more >
Installing scikit-image — skimage v0.19.2 docs
To see whether scikit-image is already installed or to check if an install has worked, run the following in a Python shell or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found