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

NoSource: No source for code: 'path/to/C/extension/pyexpat.c' (coverage==4.0) #419

Closed
nedbat opened this issue Oct 1, 2015 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@nedbat
Copy link
Owner

nedbat commented Oct 1, 2015

Originally reported by Damien Nozay (Bitbucket: dnozay, GitHub: dnozay)


coverage==3.7.1 => pass
https://travis-ci.org/xmlrunner/unittest-xml-reporting/builds/62419858

coverage==4.0 => fail
https://travis-ci.org/xmlrunner/unittest-xml-reporting/builds/81695238

coverage html --omit=.tox/*
No source for code: '/tmp/python-build.20150204184146.6052/Python-2.7.9/Modules/pyexpat.c'.

My point is that with version 4.0 it now tries to get coverage for C extensions; which I guess it didn't in 3.7.1. Is there a simple way to ignore C extension code?


@nedbat
Copy link
Owner Author

nedbat commented Oct 1, 2015

Ugh, this is stupid pyexpat calling the trace function explicitly. It's the worst thing ever, and I guess I'll have to special case it somehow...

@nedbat
Copy link
Owner Author

nedbat commented Oct 3, 2015

Hmm, there are two different errors, depending on if the pyexpat.c file couldn't be found (NoSource), or was found and then couldn't be parsed as Python (NotPython). In the NotPython case, we suppress the error, but in the NoSource case we don't.

@nedbat
Copy link
Owner Author

nedbat commented Oct 3, 2015

Fixed in ed9ed73b0401 (bb)

@nedbat
Copy link
Owner Author

nedbat commented Nov 15, 2015

Original comment by Damien Nozay (Bitbucket: dnozay, GitHub: dnozay)


thank you!

@nedbat nedbat closed this as completed Feb 9, 2016
@nedbat nedbat added major bug Something isn't working labels Jun 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant