[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] tests: fix len(contents) for error output, if contents is None

From: Neels Janosch Hofmeyr <neels_at_elego.de>
Date: Thu, 21 Aug 2008 23:13:21 +0200

Julian Foad wrote:
> On Thu, 2008-08-21 at 03:53 +0200, Neels Janosch Hofmeyr wrote:
>> [[[
>> * subversion/tests/cmdline/svntest/tree.py (pprint): Fix failure to get
>> len(contents) for error output, for the case that contents is `None'.
>> ]]]
>
> Neels, this patch fixes the case where the MIME type is set to something
> (but not something beginning with "text/") and content is None. If the
> MIME type is set, I don't think it makes sense for the content to be
> None. If some caller is setting content to None, maybe the caller is
> broken.
>
> There might be some complication, like if the object being represented
> is a deleted file, and therefore its content is None, and for some
> reason the properties have not been deleted. (There is currently a bug
> in Subversion whereby the working properties can still be accessed by
> some of svn's property commands when an object is scheduled for
> deletion. Maybe that sort of thing is happening here.)
>
> Does that make sense? Did you find a case where this happens?

Well, I had the simple case where I tried to write a test with binary data,
and I set the MIME type property, but forgot to add binary `content'.
`content' was None, the node mismatched, it tried to len() it, exception.

With the fix, instead of aborting mid-sentence and printing a test-unrelated
exception, it prints something like "contents: 0 bytes binary data" and
continues with the rest of the normal error output.

It's a corner case where one wrote a dumb test, but I'd say it should be
reported in a useful manner.

>
> - Julian
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
> For additional commands, e-mail: dev-help_at_subversion.tigris.org
>

-- 
Neels Hofmeyr -- elego Software Solutions GmbH
Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23458696  mobile: +49 177 2345869  fax: +49 30 23458695
http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelsreg: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194

Received on 2008-08-21 23:13:50 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.