今天在測試yaml的時候出現了警告
YAMLLoadWarning: calling yaml.load() without Loader=… is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
q = yaml.load(data)
查閱他給的說明:
只要指定一個加載器即可。
之前:
data = yaml.load(file_data)
改成:
data = yaml.load(file_data, Loader=yaml.FullLoader)
就不會警告了。