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

RE: svn commit: r19341 - trunk/tools/dev

From: Madan U S <madan_at_collab.net>
Date: 2006-04-13 20:10:41 CEST

Comments inline...

-----Original Message-----
From: Max Bowsher [mailto:maxb1@ukf.net]
Sent: Thu 4/13/2006 10:41 PM
To: David James
Cc: dev@subversion.tigris.org; maxb@tigris.org; Madan U S
Subject: Re: svn commit: r19341 - trunk/tools/dev
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David James wrote:
> On 4/13/06, maxb@tigris.org <maxb@tigris.org> wrote:
>> name_components = name.split()
>> if len(name_components) == 1:
>> - if name_components[0] != name:
>> - complain("Python couldn't have done that, could it?", True)
>> + name = name_components[0] # Effectively, name = name.strip()
>
> Effectively, you've just written:
> name_components = name.split()
> if len(name_components) == 1:
> name = name.strip()
> ...
>
> Why only strip "name" if len(name_components) == 1? This isn't
> correct. Here's an example test case:
> name = "Max Bowsher <max@bowsher.com> "
>
> Your name has more than one component, but it still needs to be
> stripped, so that we can correctly detect that name_components[-1][-1]
> == '>'. I think we'd be better off to apply Madan's patch, which
> correctly adds the "name.strip()" call before the split.

No, for two reasons:

1) 'name' is not referenced at all in the 'else:' block.

2) split() will eat the whitespace anyway, no need for an initial
   strip().

Madan : sure, split will eat the whitespace, but in the line...
if name_components[0] != name:
the RHS is the 'non-split' variable... which needs to be striped to be compared.

Also, its one thing to change the troublesome log... I would give some space to human error there... writing 'zhakov ' instead of 'zhakov' is not a huge mistake and *could* be permitted...

Regards,
Madan.
Received on Thu Apr 13 20:20:24 2006

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.