PyCharm执行期间的 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.

logging.config.dictConfig(yaml.load(open('logging.yml', 'r')))

我正在使用yaml.load(),当我将其更改为yaml.safe_load()时,警告消失了。在github上也有关于它的完整讨论:github.com/bioconda/bioconda-utils/issues/462 -

警告不是错误。它只是告诉你,你正在使用的YAML函数将在未来的更新中被删除,如果你更新,该函数将无法工作,所以如果有人使用较新的YAML版本,它将无法工作。

你所提到的链接确切地讨论了如何解决它以及如何摆脱它。

最新更新