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.

cython 0.29 produces invalid __path__, breaking nose

See original GitHub issue

Cython 0.29 produces invalid __path__ module attributes, breaking nosetests (and possibly other tools).

According to the Python reference, “__path__ must be an iterable of strings, but it may be empty” (Python language reference, section 5.4.5).

  • In cython 0.29, the __path__ attribute on a compiled module is None, which is not an iterable.
  • In cython 0.28.5, there is no __path__ attribute on a compiled module.

Expected behaviour: Compiled modules have a valid __path__ attribute (or omit it altogether).

Impact on nosetests:

  • When collecting tests to run, nose checks the __path__ attribute on each module; if it exists, nose attempts to iterate over it in order to find submodules to test. (If the attribute doesn’t exist, nose skips the iteration.)
  • In cython 0.29, nose attempts to iterate the invalid __path__ attribute, giving a “‘NoneType’ object is not iterable” error.
  • In cython 0.28.5, there is no __path__ attribute on a compiled module, so nose skips the iteration and proceeds without error; the new behaviour is therefore a regression as far as projects using nosetests are concerned.
  • Error message given by nose when testing a module compiled by Cython 0.29:
      File ".../lib/python3.6/site-packages/nose/loader.py", line 343, in loadTestsFromModule
        for module_path in module_paths:
    TypeError: 'NoneType' object is not iterable
    

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
hmaarrfkcommented, Oct 17, 2018

Yeah, but i would like to hear something from a Cython developer. They will probably want a test to ensure it doesn’t keep breaking things in the future.

0reactions
scodercommented, Nov 24, 2018

Hopefully fixed in 792263575b900eafd99ee0bbfbff1f14fcd70cc3.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cython 0.29 - PyPI
The Cython compiler for writing C extensions for the Python language.
Read more >
Release Notes — NumPy v1.17 Manual
Downstream developers building this release should use Cython >= 0.29.2 and, if using OpenBLAS, OpenBLAS > v0.3.7. The supported Python versions ...
Read more >
Bug listing with status RESOLVED with resolution TEST ...
Bug:233 - "Emacs segfaults when merged through the sandbox." status:RESOLVED resolution:TEST-REQUEST severity:critical · Bug:3888 - "yenta_socket module not ...
Read more >
Untitled
README 389-ds-base-git.sh 389-ds-base.spec CVE-2021-3514.patch ... ComputeLibrary.spec Cython-0.29.25.tar.gz Cython.spec 01-boundcheck.patch ...
Read more >
Release Notes — NumPy v1.17 Manual
Downstream developers should use Cython >= 0.29.13 for Python 3.8 support and ... then the incorrect value produced (either numpy.inf or numpy.nan )...
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