bad char in svn working copy on windows

Issue #74 resolved
Former user created an issue

When running a buildout on windows eventually the following error occurs:

{{{ An internal error occured due to a bug in either zc.buildout or in a recipe being used: Traceback (most recent call last): File "c:\dokume~1\build\lokale~1\temp\tmpv_s0ww\zc.buildout-1.4.3-py2.4.egg\zc\buildout\buildout.py", line 1660, in main File "c:\dokume~1\build\lokale~1\temp\tmpv_s0ww\zc.buildout-1.4.3-py2.4.egg\zc\buildout\buildout.py", line 416, in install File "c:\dokume~1\build\lokale~1\temp\tmpv_s0ww\zc.buildout-1.4.3-py2.4.egg\zc\buildout\buildout.py", line 964, in getitem File "c:\dokume~1\build\lokale~1\temp\tmpv_s0ww\zc.buildout-1.4.3-py2.4.egg\zc\buildout\buildout.py", line 1051, in _initialize File "c:\daten\devel\aurora\bots\aurorazope\build\eggs\infrae.subversion-1.4.5-py2.4.egg\infrae\subversion\Py.py", line 22, in init self._updateAllRevisionInformation() File "c:\daten\devel\aurora\bots\aurorazope\build\eggs\infrae.subversion-1.4.5-py2.4.egg\infrae\subversion\Common.py", line 146, in _updateAllRevisionInformation self._updateRevisionInformation(link, path) File "c:\daten\devel\aurora\bots\aurorazope\build\eggs\infrae.subversion-1.4.5-py2.4.egg\infrae\subversion\Py.py", line 31, in _updateRevisionInformation revision = path.status().rev File "c:\daten\devel\aurora\bots\aurorazope\build\eggs\py-1.1.1-py2.4.egg\py\impl\path\svnwc.py", line 657, in status rootstatus = WCStatus(self).fromstring(out, self) File "c:\daten\devel\aurora\bots\aurorazope\build\eggs\py-1.1.1-py2.4.egg\py\impl\path\svnwc.py", line 990, in fromstring wcpath = rootwcpath.join(fn, abs=1) File "c:\daten\devel\aurora\bots\aurorazope\build\eggs\py-1.1.1-py2.4.egg\py\impl\path\svnwc.py", line 772, in join return self.class(localpath, auth=self.auth) File "c:\daten\devel\aurora\bots\aurorazope\build\eggs\py-1.1.1-py2.4.egg\py\impl\path\svnwc.py", line 427, in new ALLOWED_CHARS): File "c:\daten\devel\aurora\bots\aurorazope\build\eggs\py-1.1.1-py2.4.egg\py\impl\path\svnwc.py", line 109, in _check_for_bad_chars return True File "c:\daten\devel\aurora\bots\aurorazope\build\eggs\py-1.1.1-py2.4.egg\py\impl\path\svnwc.py", line 109, in _check_for_bad_chars return True }}}

The bad char it chokes on is \r. I think the error is in method fromstring of class SvnAuth: In line 940 data is split by \n only. On Windows that means that \r is still part of every line and should be stripped in a subsequent step. But in line 969 the variable rest is used for matching against a regular expression without stripping the \r and consequently the variable fn in line 989 gets the \r as it's final character.

I would propose the following fix: {{{ diff -u svnwc.py.orig svnwc.py --- svnwc.py.orig 2010-01-05 11:28:51.888125000 +0100 +++ svnwc.py 2010-01-05 12:05:55.013125000 +0100 @@ -942,6 +942,7 @@ continue #print "processing %r" % line flags, rest = line[:8], line[8:] + rest = rest.rstrip() # first column c0,c1,c2,c3,c4,c5,x6,c7 = flags #if '*' in line:

}}}

Comments (2)

  1. Log in to comment