From 4f7f041ee1334c77377f4847a4d285e49156a72b Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 20 Jun 2020 18:39:40 +0800 Subject: make-fontawesome5.py: Fix YAML load warning Use `yaml.safe_load()` instead of `yaml.load()` to fix the following warning: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. In addition, add a comment that the 'icons.yml' URL that has the '/raw' part is actually correct, because we need the raw YAML data instead of the HTML page rendered by Github. --- fontawesome5/make-fontawesome5.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fontawesome5/make-fontawesome5.py b/fontawesome5/make-fontawesome5.py index 674e074..8143635 100755 --- a/fontawesome5/make-fontawesome5.py +++ b/fontawesome5/make-fontawesome5.py @@ -28,7 +28,7 @@ from datetime import datetime import yaml FA_URL = "https://github.com/FortAwesome/Font-Awesome" -ICONS_URL = FA_URL + "/raw/master/metadata/icons.yml" +ICONS_URL = FA_URL + "/raw/master/metadata/icons.yml" # NOTE: 'raw' is correct ALLOWED_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" # Fonts styles @@ -190,7 +190,7 @@ def main(): data = get_icons_yml() print("Loading icons data ...") - icons = yaml.load(data) + icons = yaml.safe_load(data) icon_list = sorted(icons.keys()) print("Number of icons: %d" % len(icon_list)) -- cgit v1.2.2