Commit 9166c4aa authored by Jim Fulton's avatar Jim Fulton

Fixed: Blank lines in buildout configuration file sections before

       options were treated as errors.
parent ec580017
Change History Change History
************** **************
2.0.0a7 (2013-01-12)
====================
Fixed: Blank lines in buildout configuration file sections before
options were treated as errors.
2.0.0a6 (2013-01-11) 2.0.0a6 (2013-01-11)
==================== ====================
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# #
############################################################################## ##############################################################################
name = "zc.buildout" name = "zc.buildout"
version = "2.0.0a6" version = "2.0.0a7"
import os import os
from setuptools import setup from setuptools import setup
......
...@@ -139,6 +139,9 @@ def parse(fp, fpname): ...@@ -139,6 +139,9 @@ def parse(fp, fpname):
optval = optval.strip() optval = optval.strip()
cursect[optname] = optval cursect[optname] = optval
blockmode = not optval blockmode = not optval
elif not (optname or line.strip()):
# blank line after section start
continue
else: else:
# a non-fatal parsing error occurred. set up the # a non-fatal parsing error occurred. set up the
# exception but keep going. the exception will be # exception but keep going. the exception will be
......
...@@ -57,5 +57,35 @@ Here's an example with leading blank lines: ...@@ -57,5 +57,35 @@ Here's an example with leading blank lines:
... text), 'test')) ... text), 'test'))
{'buildout': {'z': '1'}} {'buildout': {'z': '1'}}
Some examples that should error:
From email:
"It fails when the first non-comment line after a section (even an
otherwise empty section) is blank. For example:"
[buildout]
parts = hello
versions = versions
[versions]
# Add any version pins here.
[hello]
recipe = collective.recipe.cmd
on_install = true
on_update = true
cmds = echo Hello
.. -> text
>>> pprint.pprint(zc.buildout.configparser.parse(StringIO.StringIO(
... text), 'test'))
{'buildout': {'parts': 'hello', 'versions': 'versions'},
'hello': {'cmds': 'echo Hello',
'on_install': 'true',
'on_update': 'true',
'recipe': 'collective.recipe.cmd'},
'versions': {}}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment