[MERGE] Upgrade ConfigObj to version 4.5.1

Matt Nordhoff mnordhoff at mattnordhoff.com
Tue Feb 19 20:22:51 GMT 2008


Matt Nordhoff wrote:
> John Arbash Meinel wrote:
>> If it is only upgrading ConfigObj that seems fine. I haven't done a
>> line-by-line
>> review of the patch.
>>
>> However, I think we upgraded it once, and actually had a small
>> regression. We
>> had patched ConfigObj so that it didn't load the validation suite when we
>> weren't using it, which saved a a large amount of startup time.
>>
>> I think Andrew has been looking at startup time again, so it would be
>> nice if we
>> could coordinate any upgrade to ConfigObj with whatever needs to happen
>> to keep
>> our startup time low.
> 
> Actually, now ConfigObj only imports validate when it's actually used,
> so that's not really a problem anymore.
> 
> Ooh. I just checked, and you've patched ConfigObj in various other ways
> over the years (hasattr() -> getattr() is not None, has_key -> in, etc.).
> 
> Don't merge this until I can check that out.

Ok, done.

The changes we've made are:

  * hasattr -> getattr (1975)

  * has_key -> in (1996)

  * == None -> is None (in one doctest) (1996)
    * Doctest removed upstream

  * Fix off-by-one line number in exceptions (2904)
    * Fixed upstream in 4.3.2

  * "print >> fh" -> fh.write (in comments and doctests) (2921)
    * Upstream removed all occurrences except for one doctest.

You also did something related to writing UTF-8 to it two years ago
(1185.85.28) but backed it out immediately (1185.85.29).

About importing validate, there were never any changes made related to it.

Now, I'd be happy to change hasattr to getattr, but I think the others
are just style issues and I don't think we should make unnecessary
changes to external libraries. If you disagree, I've got a copy of
ConfigObj that breaks Python 2.2 compatibility and uses lazy_import. ;-)
-- 



More information about the bazaar mailing list