[py-dev] error on trunk in py.path.svn support

holger krekel holger at merlinux.eu
Tue Aug 19 19:48:59 CEST 2008


Hi Martijn, 

hum, this probably results from Guido's yesterday merge 
of his xmlstatus branch ... 

On Tue, Aug 19, 2008 at 19:02 +0200, Martijn Faassen wrote:
> Hi there,
>
> I just tried the trunk of Py with my project which makes very heavy use  
> of the py.path SVN facilities, and I get a lot of errors that look like  
> this:
>
>       File  
> "/home/faassen/buildout/z3c.vcsync/py/py/path/svn/wccommand.py", line
>  270, in status
>         rootstatus = XMLWCStatus(self).fromstring(out, self)
>       File  
> "/home/faassen/buildout/z3c.vcsync/py/py/path/svn/wccommand.py", line
>  687, in fromstring
>         for c in commitel.getElementsByTagName('author')[0]\
>     IndexError: list index out of range
>
> It looks to me like a certain assumption about the format of the XML  
> returned is incorrect.
>
> The SVN version on my system is svn, version 1.4.3 (r23084)
>
> When debugging it, the XML that trips up the code looks like this:
>
> <entry path="/tmp/pytest-23/wc">
> <wc-status item="normal" props="none" revision="0">
> <commit revision="0">
> <date>2008-08-19T16:50:53.400198Z</date>
> </commit>
> </wc-status>
> </entry>
>
> It looks like this means there is not always an 'author' entry in this  
> XML structure.
>
> Attached is a patch to wccommand.py that makes the problem go away (and  
> indeed seems to fix the original problem I was looking into - the trunk  
> has support for the svn status flag R, something that py 0.9.1 didn't 
> have).
>
> I realize this patch isn't enough but needs a test as well. I could find  
> no obvious way (in the form of documentation, say, the README.txt, or  
> the website) on how to actually run the tests of the trunk. :)  It's  
> quite possible I missed something.
>
> Is py 0.9.2 to be based off the work on the trunk?

yes, 0.9.2 actually mirrors trunk/py/path. 
If you could submit a test and a fix today
or early tomorrow it can definitely go in. 
(i anyway still am fighting with windows installation issues, sight). 

as to the tests: if you have "setup.py develop" 
you should be able to run 

    py.test --runslowtests py/path/svn/testing/test_wccomannd.py 

or even better :)

    py.test -n 3 --runslowtests py/path/svn/testing/test_wccomannd.py 

which doubles test speed on dual-core machines. 

you can add a test there, i guess one that just feeds a
minimal XML string into the method and checks that it groks it
fine. 

oh, and just commit, i'll review the commit (and guido as well, i guess).

thanks & best, 

holger



More information about the Pytest-dev mailing list