Skip to content

Commit

Permalink
Fix InterpolationMissingOptionError when parsing coredev 6.0 sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauritsvanrees committed Dec 1, 2021
1 parent a821f70 commit 421b8b5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions news/42.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix InterpolationMissingOptionError when parsing coredev 6.0 sources.
[maurits]
11 changes: 10 additions & 1 deletion plone/releaser/buildout.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def versions(self):
config = ConfigParser(interpolation=ExtendedInterpolation(), strict=False)
with open(self.file_location) as f:
config.read_file(f)
# https://github.com/plone/plone.releaser/issues/42
config["buildout"]["directory"] = os.getcwd()
versions = {}
for section in config.sections():
if "versions" in section.split(":"):
Expand Down Expand Up @@ -118,9 +120,15 @@ def data(self):
config.optionxform = str
with open(self.file_location) as f:
config.read_file(f)
config["buildout"]["directory"] = os.getcwd()
sources_dict = OrderedDict()
for name, value in config["sources"].items():
source = Source().create_from_string(value)
try:
source = Source().create_from_string(value)
except TypeError:
# Happens now for the documentation items in coredev 6.0.
# We could print, but this gets printed a lot.
continue
sources_dict[name] = source
return sources_dict

Expand All @@ -140,6 +148,7 @@ def data(self):
config = ConfigParser(interpolation=ExtendedInterpolation())
with open(self.file_location) as f:
config.read_file(f)
config["buildout"]["directory"] = os.getcwd()
checkouts = config.get("buildout", "auto-checkout")
checkout_list = checkouts.split("\n")
return checkout_list
Expand Down

0 comments on commit 421b8b5

Please sign in to comment.