mirror of
https://github.com/clearml/clearml
synced 2025-06-26 18:16:07 +00:00
Fix safe YAML loading
This commit is contained in:
parent
b98c821cf9
commit
df53ed5577
@ -188,7 +188,7 @@ class _Arguments(object):
|
|||||||
task_arguments[k] = const_value
|
task_arguments[k] = const_value
|
||||||
elif current_action and current_action.nargs == '+':
|
elif current_action and current_action.nargs == '+':
|
||||||
try:
|
try:
|
||||||
v = yaml.load(v.strip())
|
v = yaml.load(v.strip(), Loader=yaml.SafeLoader)
|
||||||
if current_action.type:
|
if current_action.type:
|
||||||
v = [current_action.type(a) for a in v]
|
v = [current_action.type(a) for a in v]
|
||||||
elif current_action.default:
|
elif current_action.default:
|
||||||
@ -291,7 +291,7 @@ class _Arguments(object):
|
|||||||
elif v_type == list:
|
elif v_type == list:
|
||||||
try:
|
try:
|
||||||
p = str(param).strip()
|
p = str(param).strip()
|
||||||
param = yaml.load(p)
|
param = yaml.load(p, Loader=yaml.SafeLoader)
|
||||||
except Exception:
|
except Exception:
|
||||||
self._task.log.warning('Failed parsing task parameter %s=%s keeping default %s=%s' %
|
self._task.log.warning('Failed parsing task parameter %s=%s keeping default %s=%s' %
|
||||||
(str(k), str(param), str(k), str(v)))
|
(str(k), str(param), str(k), str(v)))
|
||||||
@ -299,7 +299,7 @@ class _Arguments(object):
|
|||||||
elif v_type == dict:
|
elif v_type == dict:
|
||||||
try:
|
try:
|
||||||
p = str(param).strip()
|
p = str(param).strip()
|
||||||
param = yaml.load(p)
|
param = yaml.load(p, Loader=yaml.SafeLoader)
|
||||||
except Exception:
|
except Exception:
|
||||||
self._task.log.warning('Failed parsing task parameter %s=%s keeping default %s=%s' %
|
self._task.log.warning('Failed parsing task parameter %s=%s keeping default %s=%s' %
|
||||||
(str(k), str(param), str(k), str(v)))
|
(str(k), str(param), str(k), str(v)))
|
||||||
|
Loading…
Reference in New Issue
Block a user