From f21a0395a06f5107f9ea24388a5eb39b221b80af Mon Sep 17 00:00:00 2001 From: David Costanzo Date: Fri, 1 Mar 2024 18:21:44 -0800 Subject: [PATCH] Fix "play build-module" by replacing yaml.load with yaml.safe_load This fixes an error when "play build-module" is run on Python 3.7.11: load() missing 1 required positional argument: 'Loader' This follows the recommendation shown on https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation A loader argument is now required. This commit assumes that dependencies.yml uses standard YAML tags, and so uses safe_loader. This is the most secure loader. --- framework/pym/play/commands/modulesrepo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/pym/play/commands/modulesrepo.py b/framework/pym/play/commands/modulesrepo.py index 8e5467dc35..b3b868c4eb 100644 --- a/framework/pym/play/commands/modulesrepo.py +++ b/framework/pym/play/commands/modulesrepo.py @@ -328,7 +328,7 @@ def build(app, args, env): if os.path.exists(deps_file): f = open(deps_file) try: - deps = yaml.load(f.read()) + deps = yaml.safe_load(f.read()) if 'self' in deps: splitted = deps["self"].split(" -> ") if len(splitted) == 2: @@ -354,7 +354,7 @@ def build(app, args, env): if os.path.exists(deps_file): f = open(deps_file) - deps = yaml.load(f.read()) + deps = yaml.safe_load(f.read()) if 'self' in deps: splitted = deps["self"].split(" -> ") f.close()