diff --git a/activitysim/abm/test/test_pipeline.py b/activitysim/abm/test/test_pipeline.py index 1ad0a002d..fb2fe15a0 100644 --- a/activitysim/abm/test/test_pipeline.py +++ b/activitysim/abm/test/test_pipeline.py @@ -68,7 +68,7 @@ def close_handlers(): def inject_settings(configs_dir, **kwargs): with open(os.path.join(configs_dir, 'settings.yaml')) as f: - settings = yaml.load(f) + settings = yaml.load(f, Loader=yaml.SafeLoader) for k in kwargs: settings[k] = kwargs[k] diff --git a/activitysim/core/config.py b/activitysim/core/config.py index 73d7ae001..07b27f398 100644 --- a/activitysim/core/config.py +++ b/activitysim/core/config.py @@ -343,11 +343,9 @@ def backfill_settings(settings, backfill): logger.warn("read settings for %s from %s" % (file_name, file_path)) with open(file_path) as f: - s = yaml.load(f) + s = yaml.load(f, Loader=yaml.SafeLoader) settings = backfill_settings(settings, s) - print("settings after %s\n%s\n\n" % (file_path, settings)) - if s.get('inherit_settings', False): logger.warn("inherit_settings flag set for %s in %s" % (file_name, file_path)) continue diff --git a/activitysim/core/mp_tasks.py b/activitysim/core/mp_tasks.py index 887854a06..54fc6f9be 100644 --- a/activitysim/core/mp_tasks.py +++ b/activitysim/core/mp_tasks.py @@ -1524,7 +1524,7 @@ def read_breadcrumbs(): if not os.path.exists(file_path): raise IOError("Could not find saved breadcrumbs file '%s'" % file_path) with open(file_path, 'r') as f: - breadcrumbs = yaml.load(f) + breadcrumbs = yaml.load(f, Loader=yaml.SafeLoader) # convert array to ordered dict keyed by step name breadcrumbs = OrderedDict([(step['name'], step) for step in breadcrumbs]) return breadcrumbs diff --git a/activitysim/core/tracing.py b/activitysim/core/tracing.py index a915c16c5..027881f81 100644 --- a/activitysim/core/tracing.py +++ b/activitysim/core/tracing.py @@ -129,7 +129,8 @@ def config_logger(basic=False): if log_config_file: with open(log_config_file) as f: - config_dict = yaml.load(f) + # FIXME need alternative to yaml.UnsafeLoader? + config_dict = yaml.load(f, Loader=yaml.UnsafeLoader) config_dict = config_dict['logging'] config_dict.setdefault('version', 1) logging.config.dictConfig(config_dict) diff --git a/setup.py b/setup.py index 527d9fbe3..5d0d7b757 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ 'numpy == 1.15.4', # https://github.com/PyTables/PyTables/issues/719 'openmatrix >= 0.3.4.1', 'pandas >= 0.20.3', - 'pyyaml >= 3.0, <5.1', + 'pyyaml >= 3.0', 'tables >= 3.3.0', 'toolz >= 0.8.1', 'zbox >= 1.2',