run -m cannot find module (or package) in current directory

The directory from which coverage was started should be added at the beginning of sys.path (or perhaps even replace the first entry of sys.path, which is the directory where coverage is installed), so that coverage run -m foo can find foo in that directory (just as python -m foo can find foo in that directory).

Perhaps this modification should be made temporary though (e.g. by fooling around in execfile.py).

Create a folder package containing (empty) files __init__.py and __main__.py, and try coverage run -m package (from the folder containing package). I get the error message No module named 'package', sometimes with the extra error