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

Source directive doesn't work for packages under Jython #100

Closed
nedbat opened this issue Dec 7, 2010 · 4 comments
Closed

Source directive doesn't work for packages under Jython #100

nedbat opened this issue Dec 7, 2010 · 4 comments
Labels
bug Something isn't working

Comments

@nedbat
Copy link
Owner

nedbat commented Dec 7, 2010

Originally reported by Geoff Bache (Bitbucket: geoffbache, GitHub: Unknown)


In my rc file, I write

[run]
source = mypackage

but this fails under Jython, because __file__ returns something like

/path/to/site-packages/mypackage/__init__$py.class

and there is no code for handling this in _check_for_packages or _source_for_file.

The line

if f.startswith('__init__.'):

returns the wrong answer, and a Jython case needs adding to _source_for_file.


@nedbat
Copy link
Owner Author

nedbat commented Dec 7, 2010

Original comment by Geoff Bache (Bitbucket: geoffbache, GitHub: Unknown)


I just noticed this

http://nedbatchelder.com/blog/201005/coveragepy_on_jython.html

i.e. that Jython wasn't really officially supported. The filenames themselves also need processing when "coverage run" is executed for it to work. But with code that treats $py.class in the same way as .pyc, it appears to work well on my code base now.

Will attach a patch later.

@nedbat
Copy link
Owner Author

nedbat commented Dec 10, 2010

Original comment by Geoff Bache (Bitbucket: geoffbache, GitHub: Unknown)


Attaching patch

@nedbat
Copy link
Owner Author

nedbat commented Nov 23, 2012

Applied the patch <<changeset df42cb15889d6dccc82c9bbaefc910e0706cbb13 (bb)>> by merging your change. Can you try the tip and see if it works? I'm going to do a little refactoring also.

@nedbat
Copy link
Owner Author

nedbat commented Nov 27, 2012

Fixed in <<changeset df42cb15889d6dccc82c9bbaefc910e0706cbb13 (bb)>>

@nedbat nedbat closed this as completed Nov 27, 2012
@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