changeset 1164:727110ea112a

core: Remove more YAML deprecation warnings.
author Ludovic Chabant <ludovic@chabant.com>
date Fri, 04 Oct 2019 08:48:07 -0700
parents ed308313bcda
children a928ee22c20a
files piecrust/commands/builtin/themes.py piecrust/importing/jekyll.py piecrust/importing/piecrust.py piecrust/processing/pygments_style.py piecrust/processing/sitemap.py
diffstat 5 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/piecrust/commands/builtin/themes.py	Tue Oct 01 07:35:50 2019 -0700
+++ b/piecrust/commands/builtin/themes.py	Fri Oct 04 08:48:07 2019 -0700
@@ -75,7 +75,7 @@
         if os.path.exists(info_path):
             info = None
             with open(info_path, 'r', encoding='utf8') as fp:
-                theme_cfg = yaml.load(fp.read())
+                theme_cfg = yaml.safe_load(fp.read())
                 if isinstance(theme_cfg, dict):
                     info = theme_cfg.get('theme')
             if info:
--- a/piecrust/importing/jekyll.py	Tue Oct 01 07:35:50 2019 -0700
+++ b/piecrust/importing/jekyll.py	Fri Oct 04 08:48:07 2019 -0700
@@ -47,7 +47,7 @@
     def convertConfig(self, app, src_path):
         logger.debug("  Converting configuration file.")
         with open(src_path, 'r', encoding='utf8') as fp:
-            config = yaml.load(fp)
+            config = yaml.safe_load(fp)
 
         if 'site' not in config:
             config['site'] = {}
--- a/piecrust/importing/piecrust.py	Tue Oct 01 07:35:50 2019 -0700
+++ b/piecrust/importing/piecrust.py	Fri Oct 04 08:48:07 2019 -0700
@@ -96,7 +96,7 @@
                 shutil.rmtree(item_path)
 
     def convertConfig(self, content):
-        config = yaml.load(content)
+        config = yaml.safe_load(content)
         sitec = config.setdefault('site', {})
         if 'templates_dirs' in sitec:
             tdc = sitec['templates_dirs']
--- a/piecrust/processing/pygments_style.py	Tue Oct 01 07:35:50 2019 -0700
+++ b/piecrust/processing/pygments_style.py	Fri Oct 04 08:48:07 2019 -0700
@@ -11,7 +11,7 @@
 
     def _doProcess(self, in_path, out_path):
         with open(in_path, 'r') as fp:
-            config = yaml.load(fp)
+            config = yaml.safe_load(fp)
 
         style_name = config.get('style', 'default')
         class_name = config.get('class', '.highlight')
--- a/piecrust/processing/sitemap.py	Tue Oct 01 07:35:50 2019 -0700
+++ b/piecrust/processing/sitemap.py	Fri Oct 04 08:48:07 2019 -0700
@@ -36,7 +36,7 @@
 
     def _doProcess(self, in_path, out_path):
         with open(in_path, 'r') as fp:
-            sitemap = yaml.load(fp)
+            sitemap = yaml.safe_load(fp)
 
         try:
             with open(out_path, 'w') as fp: