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.

classification
Title: distutils sdist does not exclude SVN/CVS files on Windows
Type: behavior Stage:
Components: Distutils Versions: Python 2.6
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: tarek Nosy List: christian.heimes, georg.brandl, guy-dalberto, schmir, tarek
Priority: normal Keywords:

Created on 2007-04-17 23:29 by guy-dalberto, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (6)
msg31825 - (view) Author: Guy Dalberto (guy-dalberto) Date: 2007-04-17 23:29
+ Bug is specific to Windows platform

+ When creating a source distribution with :
**setup.py sdist**

+ the files in CVS/RCS/.svn folders should be     excluded, as specified by paragraph 4.1 of  distutils documentation

+ on windows, they are not excluded, because :
   + the pattern is r'/(RCS|CVS|\.svn)/.*'
   + the filepathes are in the perverse Windows style (separated by backslashes)

+ I could exclude those files by doing either :
  + add a <<global-exclude .svn/*>> in manifest.in
  + modify line 357 of distutils/command/sdist.py

+ initial line
self.filelist.exclude_pattern(r'/(RCS|CVS|\.svn)/.*', is_regex=1)

+ modified lines
reossep = (os.sep == '/' and '/' or r'\\')
self.filelist.exclude_pattern(r'%s(RCS|CVS|\.svn)%s.*' % (reossep, reossep), is_regex=1)
msg59794 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-01-12 05:15
The code should use \ and / on Windows.
msg78635 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2008-12-31 17:07
I have put this ticket in my pile.

I will write the test to demonstrate the problem and get back to your
patch proposal.

As Christian said, both separator should be taken care of under Windows,
so the final regexp will be slighly different.

Last, the trunk code has evolved a bit since your initial proposal, and
now includes other VCSs like Mercurial or Git.
msg79026 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2009-01-04 00:17
Fixed in r68276.

I have added a test together with the patch, and slighty changed your fix.

It's applied in the trunk, and 2.6 as well (it will be forwardported
into 3.x as well)

Thanks for the feedback and the solution !
msg79027 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-01-04 00:19
Tarek, I don't know if you are already subscribed to the python-checkins
mailing list -- I've reviewed the commit and posted a reply with a minor
problem there.
msg79030 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2009-01-04 00:40
Georg, I think I am supposed to be registered since a few days but I
don't receive any mail yet. I'll ask...

I didn't use a raw string because '\.' is not an escape sequence,
so:

  >>> '\.svn' == '\\.svn' and '\.svn' == r'\.svn'
  True
History
Date User Action Args
2022-04-11 14:56:23adminsetgithub: 44858
2009-01-04 00:40:37tareksetmessages: + msg79030
2009-01-04 00:19:49georg.brandlsetnosy: + georg.brandl
messages: + msg79027
2009-01-04 00:17:34tareksetstatus: open -> closed
messages: + msg79026
2008-12-31 17:07:24tareksetassignee: tarek
messages: + msg78635
nosy: + tarek
2008-03-14 19:37:09schmirsetnosy: + schmir
2008-01-12 05:15:33christian.heimessettype: behavior
messages: + msg59794
nosy: + christian.heimes
versions: + Python 2.6, - Python 2.5
2007-04-17 23:29:54guy-dalbertocreate