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 nadeem.vawda
Recipients Adam.Groszer, cjw296, eric.araujo, jaraco, nadeem.vawda, tarek
Date 2012-02-20.12:58:27
SpamBayes Score 1.8002266e-13
Marked as misclassified No
Message-id <1329742708.25.0.89791852459.issue6884@psf.upfronthosting.co.za>
In-reply-to
Content
> (2.7.2 doesn’t include neither Antoine’s changeset nor mine, right?)

Correct; it dates back to June last year, before issue 13193 was filed.


> Can you reproduce the “include buildout.cfg” bug too?

Yes, that problem is present in 2.7.2, but not in the current revision of
the 2.7 branch. In 2.7.2, the offending regex is r'^build\.*' (since
translate_pattern() uses os.path.join, and doesn't escape the separator),
whereas in 2.7-head the regex is r'^build/.*' (using a hardcoded "/").
2.7-head with your patch applied gives r'^build\\.*' (the correct value).

In this case (unlike #9691 and #14004), the problem was fixed by the
changes in issue 13193, since the offending code is in the
"if prefix is not None:" codepath of translate_pattern(), rather than in
glob_to_re().


While we're talking about translate_pattern(), I have a question about
this line:

    pattern_re = "^%s/.*%s" % (prefix_re, pattern_re)

It seems that if you specify both a prefix and a (nonempty) pattern, the
resulting regexp is something like "<PREFIX>/.*<PATTERN>", using the
pattern argument as a suffix. Is this the intended behavior? I would have
expected something like "<PREFIX>/(.*/)?<PATTERN>", defaulting to
"<PREFIX>/.*" if pattern is empty. For example, it seems wrong that
"recursive-include foo bar.*" matches foo/test_bar.py.
History
Date User Action Args
2012-02-20 12:58:28nadeem.vawdasetrecipients: + nadeem.vawda, jaraco, cjw296, tarek, eric.araujo, Adam.Groszer
2012-02-20 12:58:28nadeem.vawdasetmessageid: <1329742708.25.0.89791852459.issue6884@psf.upfronthosting.co.za>
2012-02-20 12:58:27nadeem.vawdalinkissue6884 messages
2012-02-20 12:58:27nadeem.vawdacreate