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

Cython.Coverage produces error when using gevent #2776

wjsi opened this Issue Jan 2, 2019 · 2 comments


None yet
2 participants
Copy link

wjsi commented Jan 2, 2019


I build a simple pyx with gevent module ( and try to use Cython.Coverage to get code coverage, it produces an error when coverage report is executed:

$ coverage run
$ coverage report
Plugin 'Cython.Coverage.Plugin' did not provide a file reporter for '/Users/wenjun.swj/miniconda3/lib/python3.7/site-packages/gevent/'.

When gevent is removed, for instance, replaced with time module, no errors raised and the report is shown normally.

I uploaded all test files in I'm running on MacOS 10.14 with Anaconda Python 3.7.1, cython==0.29.2 and coverage==4.5.2.

@wjsi wjsi referenced a pull request that will close this issue Jan 5, 2019


Fix inconsistency between traced files and reported files #2784


This comment has been minimized.

Copy link

scoder commented Jan 11, 2019

Thanks for the report. I have no idea what gevent does here, so this needs more investigation to find out how this differs from normal CPython behaviour and what can be done to make this work.


This comment has been minimized.

Copy link

wjsi commented Jan 11, 2019

@scoder during compilation, gevent compiles its in using cython into and then import the compiled lib on the bottom of to get itself accelerated, which produces a _hub_local.c with path gevent/src/gevent/_hub_local.c. However, when installed as a wheel package, the path becomes gevent/_hub_local.c, therefore Cython.Coverage cannot spot the path of When creating the tracer, it reports no errors. However, when creating the reporter, no source file can be spotted and the error occurs.
I've written a test case to reproduce this error in #2784.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment