[Distutils] zc.buildout 2.0.0a6 released: updated config-file syntax

Maurits van Rees m.van.rees at zestsoftware.nl
Sat Jan 12 00:05:44 CET 2013

Op 11-01-13 17:30, Jim Fulton schreef:
> I've just released zc.buildout-2.0.0a6.
> The primary change in this release is that the configuration-file
> syntax has changed:
> - Relative indentation in option values is retained if the first
>    line is blank. (IOW, if the non-blank text is on the continuation
>    lines.) As in::
>       [mysection]
>       tree =
>         /root
>           /branch
>    In such cases, internal blank lines are also retained.
> - The configuration syntax is more tightly defined, allowing fewer
>    syntax definitions.
>    Buildout 1 configuration files were parsed with the Python
>    ConfigParser module. The ConfigParser module's format is poorly
>    documented and wildly flexible. For example:
>    - Any characters other than left square brackets were allowed in
>      section names.
>    - Arbitrary text was allowed and ignored after the closing bracket on
>      section header lines.
>    - Any characters other than equal signs or colons were allowed in an
>      option name.
>    - Configuration options could be spelled as RFC 822 mail headers
>      (using a colon, rather than an equal sign).
>    - Comments could begin with "rem".
>    - Semicolons could be used to start inline comments, but only if
>      preceeded by a whitespace character.
> See http://pypi.python.org/pypi/zc.buildout/2.0.0a6#configuration-file-syntax
> This potentially the most controversial backward-incompatible
> change in buildout 2, so try it out and let me know if the
> changes present any serious problems.

It fails when the first non-comment line after a section (even an 
otherwise empty section) is blank.  For example:

$ cat buildout.cfg

parts = hello
versions = versions

# Add any version pins here.


recipe = collective.recipe.cmd
on_install = true

on_update = true
cmds = echo Hello

For this file, three of the five empty lines give a problem:

$ bin/buildout

An internal error occured due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
line 1743, in main
     command, args)
line 202, in __init__
     data['buildout'].copy(), override, set()))
line 1384, in _open
     result = zc.buildout.configparser.parse(fp, filename)
line 153, in parse
     raise e
ParsingError: File contains parsing errors: 
	[line  2]: '\n'
	[line  8]: '\n'
	[line 10]: '\n'

These empty lines are not truly necessary, but they can make files more 
readable, so it would be good if buildout could be more forgiving here.

Other than that, my standard Plone buildout setup for clients, with 
several config files, finishes without error and seems to work fine. 
(Python 2.7, Mac OSX 10.8.2.)


Maurits van Rees: http://maurits.vanrees.org/
Zest Software: http://zestsoftware.nl

More information about the Distutils-SIG mailing list