Problems running

Skip Montanaro skip at
Mon Aug 30 17:35:14 CEST 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\", line 20, in _run_exitfuncs
    Vijay>     func(*targs, **kargs)
    Vijay>   File "D:\Python23\Lib\site-packages\", line 207, in save
    Vijay>     cache = open(self.cache, 'wb')
    Vijay> TypeError: an integer is required

    Vijay> Looks like 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

Skip Montanaro
Got spam?
skip at

More information about the Python-list mailing list