diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py --- a/Lib/distutils/command/sdist.py +++ b/Lib/distutils/command/sdist.py @@ -345,15 +345,13 @@ class sdist(Command): self.filelist.exclude_pattern(None, prefix=base_dir) # pruning out vcs directories - # both separators are used under win32 - if sys.platform == 'win32': - seps = r'/|\\' - else: - seps = '/' + sep = os.sep + if os.sep == '\\': + sep = r'\\' vcs_dirs = ['RCS', 'CVS', r'\.svn', r'\.hg', r'\.git', r'\.bzr', '_darcs'] - vcs_ptrn = r'(^|%s)(%s)(%s).*' % (seps, '|'.join(vcs_dirs), seps) + vcs_ptrn = r'(^|%s)(%s)(%s).*' % (sep, '|'.join(vcs_dirs), sep) self.filelist.exclude_pattern(vcs_ptrn, is_regex=1) def write_manifest(self): diff --git a/Lib/distutils/filelist.py b/Lib/distutils/filelist.py --- a/Lib/distutils/filelist.py +++ b/Lib/distutils/filelist.py @@ -297,11 +297,12 @@ def glob_to_re(pattern): # 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'((?