diff bitten/build/pythontools.py @ 595:538e4f975505

0.6dev: Fix for filenames in pylint report that made incorrect absolute pathnames. Filenames should now be properly shortened, and link correctly to source browser from lint report. Also added some tests for lint report filename handling. Closes #418.
author osimons
date Mon, 27 Jul 2009 21:48:24 +0000
parents ab4f39c2fae5
children 3e018dcb1b91
line wrap: on
line diff
--- a/bitten/build/pythontools.py
+++ b/bitten/build/pythontools.py
@@ -152,10 +152,11 @@
                     category = msg_categories.get(msg_type[0])
                     if len(msg_type) == 1:
                         msg_type = None
-                    filename = os.path.realpath(match.group('file'))
-                    if filename.startswith(ctxt.basedir):
+                    filename = match.group('file')
+                    if os.path.isabs(filename) \
+                            and filename.startswith(ctxt.basedir):
                         filename = filename[len(ctxt.basedir) + 1:]
-                    filename = filename.replace(os.sep, '/')
+                    filename = filename.replace('\\', '/')
                     lineno = int(match.group('line'))
                     tag = match.group('tag')
                     problems.append(xmlio.Element('problem', category=category,
Copyright (C) 2012-2017 Edgewall Software