相关疑难解决方法(0)

如何忽略Python中的弃用警告

我一直这样:

DeprecationWarning: integer argument expected, got float
Run Code Online (Sandbox Code Playgroud)

如何让这条消息消失?有没有办法避免Python中的警告?

python warnings ignore deprecated

151
推荐指数
10
解决办法
14万
查看次数

在Python中使用Paramiko时如何静音EllipticCurvePublicNumbers.encode_point密码学不建议使用警告

密码术弃用警告:

EllipticCurvePublicNumbers上不推荐使用encode_point,并且在以后的版本中将删除它。请使用EllipticCurvePublicKey.public_bytes来获取压缩和未压缩的点编码。

python ssh paramiko deprecation-warning

8
推荐指数
2
解决办法
2976
查看次数

如何在 ansible 中使 paramiko CryptographyDeprecationWarnings 静音

我在 macOS 上运行 Ansible 2.7.6。

每次我运行剧本时,我都会一遍又一遍地收到相同的警告:

/usr/local/lib/python3.7/site-packages/paramiko/ecdsakey.py:164: CryptographyDeprecationWarning: 对从编码数据不安全构造公众号的支持将在未来版本中删除。请使用 EllipticCurvePublicKey.from_encoded_point

我知道问题出在 ansible 正在使用的 paramiko Python 库上。这个问题将在下一个版本中修复,但尚未发布。现在有没有简单的方法来抑制这些警告?

paramiko ansible

2
推荐指数
1
解决办法
5031
查看次数