This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vrutsky
Recipients vrutsky
Date 2011-01-12.14:44:16
SpamBayes Score 1.6497208e-07
Marked as misclassified No
Message-id <1294843489.43.0.983792093108.issue10896@psf.upfronthosting.co.za>
In-reply-to
Content
This is code from recent trace.py (http://svn.python.org/view/python/branches/release27-maint/Lib/trace.py?view=markup):

trace.py:169:
        # Ignore a file when it contains one of the ignorable paths
        for d in self._dirs:
            # The '+ os.sep' is to ensure that d is a parent directory,
            # as compared to cases like:
            #  d = "/usr/local"
            #  filename = "/usr/local.py"
            # or
            #  d = "/usr/local.py"
            #  filename = "/usr/local.py"
            if filename.startswith(d + os.sep):
                self._ignore[modulename] = 1
                return 1

Directories comparison like "filename.startswith(d + os.sep)" works incorrect on case-insensitive filesystems (such as NTFS on Windows).

This leads to confusing results on Windows:
  python trace.py --ignore-dir='$prefix' -t test.py
or
  python trace.py --ignore-dir C:\Python26\Lib -t test.py
shows all calls from standard library, but this one doesn't:
  python trace.py --ignore-dir=c:\python26\lib -t test.py

See attached test files and log for details.
History
Date User Action Args
2011-01-12 14:44:49vrutskysetrecipients: + vrutsky
2011-01-12 14:44:49vrutskysetmessageid: <1294843489.43.0.983792093108.issue10896@psf.upfronthosting.co.za>
2011-01-12 14:44:16vrutskylinkissue10896 messages
2011-01-12 14:44:16vrutskycreate