[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: Max Bowsher <maxb1_at_ukf.net>
Date: 2006-04-13 19:11:14 CEST

-----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().

Max.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)

iD8DBQFEPoYyfFNSmcDyxYARAlr+AJ0fdsWXvW1qZJtEfz2uMrhRM9ITmwCg1WG1
sArv1SmVISOMa5HJFhVU//w=
=8O0R
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Apr 13 19:14:53 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.