From b621fd439bc214035ca78478d50a5c4fd775efdc Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Fri, 27 Mar 2015 22:39:38 -0400 Subject: [PATCH] Fix redaction in non-full dumps --- beets/util/confit.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/beets/util/confit.py b/beets/util/confit.py index de137107b..64f282684 100644 --- a/beets/util/confit.py +++ b/beets/util/confit.py @@ -862,7 +862,9 @@ class Configuration(RootView): else: # Exclude defaults when flattening. sources = [s for s in self.sources if not s.default] - out_dict = RootView(sources).flatten(redact=redact) + temp_root = RootView(sources) + temp_root.redactions = self.redactions + out_dict = temp_root.flatten(redact=redact) yaml_out = yaml.dump(out_dict, Dumper=Dumper, default_flow_style=None, indent=4, @@ -874,7 +876,7 @@ class Configuration(RootView): if source.default: default_source = source break - if default_source: + if default_source and default_source.filename: with open(default_source.filename, 'r') as fp: default_data = fp.read() yaml_out = restore_yaml_comments(yaml_out, default_data)