YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe
test.py
import os
import sys
sys.path.append("/".join(os.path.dirname(os.path.abspath(__file__)).split("/")[:-])+'/lib/lib3.7')
import yaml
with open("default.yaml") as f:
yaml_dict = yaml.load(f)
PyYAML 5.1 deprecation of the plain yaml.load(input) function .
bogon:conf macname$ python3. test.py
test.py:: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
yaml_dict = yaml.load(f)
解决掉警告的方法:
yaml.warnings({'YAMLLoadWarning': False})
yaml.load(input, Loader=yaml.FullLoader)
PYTHONWARNINGS=ignore::yaml.YAMLLoadWarning
参考:
https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation
YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe的更多相关文章
- YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. data = yaml.load(file_data)
YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsa ...
- 执行yaml.load()出现警告信息:YAMLLoadWarning: callingyaml.load() without Loader=..
执行yaml.load()出现警告信息:YAMLLoadWarning: callingyaml.load() without Loader=... 原因: yaml5.1版本后弃用了yaml.loa ...
- ruby YAML.load 和YAML.load_file区别
1. load( io ) Load a document from the current io stream. File.open( 'animals.yaml' ) { |yf| YAML::l ...
- 11 loader - 配置处理scss文件的loader
1.装包 cnpm i sass-loader -D peerDependencies WARNING sass-loader@* requires a peer of node-sass@^4.0. ...
- 10 loader - 配置处理less文件的loader
第一步:装包 cnpm i less-loader -D 安装完提示警告 peerDependencies WARNING less-loader@* requires a peer of less@ ...
- 更适合Pythoner的标记语言Yaml学习总结
pythonic的标记语言 之前总结过一篇关于小数据存储文件大比拼,当时着重介绍了json,因为它在各类编程语言的通用性较强.但今天,我想给大家介绍一款更加适合pythoner使用的语言Yaml. Y ...
- python+Appium自动化:读取Yaml配置文件
Yaml简介 Yaml:"Yet Another Markup Language"(是一种标记语言),但为了强调这种语言以数据做为中心,而不是以标记语言为重点,而用反向缩略语重命名 ...
- python 使用yaml模块
python:yaml模块一.yaml文件介绍YAML是一种简洁的非标记语言.其以数据为中心,使用空白,缩进,分行组织数据,从而使得表示更加简洁.1. yaml文件规则基本规则: 大小写敏感 ...
- vulnhub: DC 3
通过nmap扫描,只开放了80端口,并且该web服务是基于Joomla搭建: root@kali:~# nmap -A 192.168.74.140 Starting Nmap 7.80 ( http ...
随机推荐
- SpringMVC中的400错误,The request sent by the client was syntactically incorrect.
在其他对象属性类型一样情况下,只需要创建一个类,再在springmvc.xml中添加配置: package com.ujiuye.common; import org.springframework. ...
- python基础08--迭代器,生成器
1.1 迭代器 1.可迭代对象:str,list,tuple,set,dict, 迭代器:f(文件),range() 可迭代对象和迭代器都可以for循环 可迭代对象不会计数, 迭代器会计数,上面操作到 ...
- 编写可维护的JavaScript-随笔(四)
避免使用全局变量 一.全局变量带来的问题 a) 命名冲突 i. 当全局变量和全局函数越来越多时,发生命名冲突的概率也随之增高 ii. 如果函数中使用了外部 ...
- 没有用到React,为什么我需要import引入React?
没有用到React,为什么我需要import引入React? 本质上来说JSX是React.createElement(component, props, ...children)方法的语法糖. 所以 ...
- Keras上实现简单线性回归模型
版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/marsjhao/article/detai ...
- springboot+https+http
http访问不安全,使用https相对好些. 参考网址:https://blog.csdn.net/bock1984/article/details/90116965 操作如下: 1. 使用JDK自带 ...
- windows中的出站和入站规则
一.规则介绍 规则生效的前提是防火墙处于开启状态. windows系统默认的规则:默认阻止入站连接,默认允许出站连接.也就是说,凡是入站连接,任何程序和端口都要在防火墙上配置入站规则,否则都会被禁止. ...
- 使用Kubeadm安装Kubernetes【单Master节点】
参考:Kubernetes官方文档 Kubernetes安装方案选择 Centos 7 配置科学上网 安装Calico网络插件 kubernetes-dashboard部署 Kubernetes ...
- Flask+SQLAlchemy+graphene+docker示例
搭建一个利用docker启动服务的Flask的小demo 定义数据库 # -*- coding: utf-8 -*- from sqlalchemy import * from sqlalchemy. ...
- shell脚本条件判断if中-a到-z的意思
[ -a FILE ] 如果 FILE 存在则为真. [ -b FILE ] 如果 FILE 存在且是一个块特殊文件则为真. [ -c FILE ] 如果 FILE 存在且是一个字特殊文件则 ...