changeset: 76187:b5f0ce4ddf0c branch: 2.7 parent: 75837:48172fcea164 user: Éric Araujo date: Sat Feb 25 16:13:53 2012 +0100 files: Lib/distutils/filelist.py Lib/distutils/tests/test_filelist.py Lib/distutils/tests/test_sdist.py Misc/NEWS description: Fix long-standing bugs with MANIFEST.in parsing on Windows (#6884). These regex changes fix a number of issues for distutils on Windows: - #6884: impossible to include a file starting with 'build' - #9691 and #14004: sdist includes too many files - #13193: test_filelist failures This commit replaces the incorrect changes done in 557a973709de, c566a3447ba1 and 3925081a7ca0 to fix #13193; we were too eager to fix the test failures and I did not study the code enough before greenlighting patches. This time we have unit tests from the problems reported by users to be sure we have the right fix. Thanks to Nadeem Vawda for his help. diff -r 48172fcea164 -r b5f0ce4ddf0c Lib/distutils/filelist.py --- a/Lib/distutils/filelist.py Tue Mar 20 10:40:26 2012 -0400 +++ b/Lib/distutils/filelist.py Sat Feb 25 16:13:53 2012 +0100 @@ -210,6 +210,7 @@ Return 1 if files are found. """ + # XXX docstring lying about what the special chars are? files_found = 0 pattern_re = translate_pattern(pattern, anchor, prefix, is_regex) self.debug_print("include_pattern: applying regex r'%s'" % @@ -297,11 +298,14 @@ # IMHO is wrong -- '?' and '*' aren't supposed to match slash in Unix, # and by extension they shouldn't match such "special characters" under # any OS. So change all non-escaped dots in the RE to match any - # character except the special characters. - # XXX currently the "special characters" are just slash -- i.e. this is - # Unix-only. - pattern_re = re.sub(r'((?