ANN: ConfigObj 4.7.2 Release

Michael Foord fuzzyman at
Tue Mar 2 16:23:30 CET 2010

A new version of ConfigObj has just been released: 4.7.2

This is a bugfix release with several important bugfixes. It is 
recommended that all users of ConfigObj 4.7 update.

* Download:
* PyPI Page:
* Documentation:

The new version can be installed with::

     pip install -U configobj


* BUGFIX: Restore Python 2.3 compatibility
* BUGFIX: Members that were lists were being returned as copies due to
    interpolation introduced in 4.7. Lists are now only copies if 
    changes a list member. (See below.)
* BUGFIX: ``pop`` now does interpolation in list values as well.
* BUGFIX: where interpolation matches a section name rather than a value
    it is ignored instead of raising an exception on fetching the item.
* BUGFIX: values that use interpolation to reference members that don't
    exist can now be repr'd.
* BUGFIX: Fix to avoid writing '\r\r\n' on Windows when `write` is given
    a file opened in text mode ('w').

See below for important details on the change to using list values with 
string interpolation.

What is ConfigObj?

**ConfigObj** is a simple but powerful config file reader and writer: an 
file round tripper*. Its main feature is that it is very easy to use, with a
straightforward programmer's interface and a simple syntax for config files.
ConfigObj has a host of powerful features:

* Nested sections (subsections), to any level
* List values
* Multiple line values
* Full Unicode support
* String interpolation (substitution)
* Integrated with a powerful validation system

     - including automatic type checking/conversion
     - and allowing default values
     - repeated sections

* All comments in the file are preserved
* The order of keys/sections is preserved
* Powerful ``unrepr`` mode for storing/retrieving Python data-types

String Interpolation and List Values

For general information on string interpolation in ConfigObj see:

Since version 4.7 string interpolation is done on string members of list 
values. If interpolation changes any members of the list then what you 
get back is a /copy/ of the list rather than the original list.

This makes fetching list values slightly slower when interpolation is 
on, it also means that if you mutate the list changes won't be reflected 
in the original list:

>>>  c  =  ConfigObj()
>>>  c['foo']  =  'boo'
>>>  c['bar']  =  ['%(foo)s']
>>>  c['bar']
>>>  c['bar'].append('fish')
>>>  c['bar']

Instead of mutating the list you must create a new list and reassign it.


More information about the Python-announce-list mailing list