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 ...
随机推荐
- 两数相加(C#数据结构和算法练习)
两数相加 给出两个 非空 的链表用来表示两个非负的整数.其中,它们各自的位数是按照 逆序 的方式存储的,并且它们的每个节点只能存储 一位 数字. 如果,我们将这两个数相加起来,则会返回一个新的链表来表 ...
- windows环境:dos 通过ftp连接到vsftpd 显示乱码解决方法
转载至:https://blog.csdn.net/nydia_xiangxiang/article/details/48627921?utm_source=blogxgwz8 感谢原作者的分享 FT ...
- Django:RestFramework之-------序列化器
8.序列化 功能: 对请求数据进行验证 对Queryset进行序列化 8.1一个简单序列化: import json from api import models from rest_framewor ...
- MES被重新定义?做到这几点才算智能制造
在工业4.0背景下,推动智能制造,构建智能工厂.智能生产.智能物流和智能服务体系,我们需要对MES系统重新进行定义,主要从以下几个方面进行说明: MES深度融入企业运营环节 智能工厂中的机器将全部由软 ...
- select用法 多并发处理
select默认最大检查套接口数量是1024,有定义 #define __NFDBITS (8 * sizeof(unsigned long)) #define __FD_SETSIZE 1024 # ...
- set_lb
修改lb权重,通知钉钉 前提需要安装阿里的核心库 #!/usr/local/python-3.6.4/bin/python3 #coding=utf-8 from aliyunsdkcore.clie ...
- etcd和flannel实现docker跨物理机通信
实验目标 跨物理机的容器之间能直接访问docker通过Flannel可以实现各容器间的相互通信,即宿主机和容器,容器和容器之间都能相互通信 实验环境 192.168.3.50 //etcd.flann ...
- web服务器-apache
一.apache详解 1. 概述 apache是世界上使用排名第一的web服务器软件.它可以运行在几乎所有广泛使用的计算机平台上,由于其跨平台和安全性被广泛使用,是最流行的web服务器端软件之一.它快 ...
- Spring Cloud注册中心Eureka设置访问权限并自定义鉴权页面
原文:https://blog.csdn.net/a823007573/article/details/88971496 使用Spring Security实现鉴权 1. 导入Spring Secur ...
- httprunner学习16-locust性能测试
前言 HttpRunner 的 yaml 脚本文件,可以结合locust做性能测试 locust环境准备 安装完成 HttpRunner 后,系统中会新增locusts命令,但不会同时安装 Locus ...