cython 0.29 produces invalid __path__, breaking nose
See original GitHub issueCython 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 isNone
, 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:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
Hopefully fixed in 792263575b900eafd99ee0bbfbff1f14fcd70cc3.