Problems running coverage.py

Skip Montanaro skip at pobox.com
Mon Aug 30 11:35:14 EDT 2004


    Vijay> For a particular script which uses 'exit' calls, I am getting the
    Vijay> following error when I invoke the script with the -x option for
    Vijay> coverage.

    Vijay> Error in sys.exitfunc:
    Vijay> Traceback (most recent call last):
    Vijay>   File "D:\Python23\lib\atexit.py", line 20, in _run_exitfuncs
    Vijay>     func(*targs, **kargs)
    Vijay>   File "D:\Python23\Lib\site-packages\coverage.py", line 207, in save
    Vijay>     cache = open(self.cache, 'wb')
    Vijay> TypeError: an integer is required

    Vijay> Looks like coverage.py is not able to record the coverage data on
    Vijay> calling exit.  Does anybody know how to solve this?

Just a wild-ass guess, but I suspect there's a module imported like

    from somemodule import *

which dumped an "open" symbol into the global namespace, thus hiding the
open() builtin.  You might try adding this line

    print open

right before the call to open() to see if you're getting the builtin open or
not.

-- 
Skip Montanaro
Got spam? http://www.spambayes.org/
skip at pobox.com



More information about the Python-list mailing list