coverage: deal with symlinked input paths (MacOSX issue)
/tmp is symlinked in MacOSX therefore test scripts as well as python modules
are installed in a symlinked location. coverage.py uses abspath() to normalize
its inputs which fails if these are referencing real paths. Use realpath()
instead.
--- a/tests/coverage.py Sat Mar 22 18:01:46 2008 +0100
+++ b/tests/coverage.py Sat Mar 22 19:01:09 2008 +0100
@@ -412,6 +412,9 @@
else:
omit = []
+ omit = [os.path.normcase(os.path.abspath(os.path.realpath(p)))
+ for p in omit]
+
if settings.get('report'):
self.report(args, show_missing, ignore_errors, omit_prefixes=omit)
if settings.get('annotate'):
@@ -537,7 +540,7 @@
if os.path.exists(g):
f = g
break
- cf = os.path.normcase(os.path.abspath(f))
+ cf = os.path.normcase(os.path.abspath(os.path.realpath(f)))
self.canonical_filename_cache[filename] = cf
return self.canonical_filename_cache[filename]