From 4d0cf8000ae14f6662e52fda14eb390474cab6e8 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Wed, 3 May 2017 18:42:47 -0700 Subject: [PATCH] make a copy of keys in all python versions (#4614) * make a copy of keys in all python versions * documentation++ --- certbot-apache/certbot_apache/configurator.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/certbot-apache/certbot_apache/configurator.py b/certbot-apache/certbot_apache/configurator.py index 3dd9aae5f..2885cd0ef 100644 --- a/certbot-apache/certbot_apache/configurator.py +++ b/certbot-apache/certbot_apache/configurator.py @@ -603,7 +603,9 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): file_paths = {} internal_paths = defaultdict(set) vhs = [] - for vhost_path in self.parser.parser_paths.keys(): + # Make a list of parser paths because the parser_paths + # dictionary may be modified during the loop. + for vhost_path in list(self.parser.parser_paths): paths = self.aug.match( ("/files%s//*[label()=~regexp('%s')]" % (vhost_path, parser.case_i("VirtualHost"))))