Suppress cryptography warnings for paramiko (#83772)

pull/83773/head
Matt Clay 3 months ago committed by GitHub
parent 68515abf97
commit b25afbb4e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,2 @@
minor_changes:
- Suppress cryptography deprecation warnings for Blowfish and TripleDES when the ``paramiko`` Python module is installed.

@ -11,7 +11,12 @@ PARAMIKO_IMPORT_ERR = None
try: try:
with warnings.catch_warnings(): with warnings.catch_warnings():
warnings.filterwarnings('ignore', message='Blowfish has been deprecated', category=UserWarning) # Blowfish has been moved, but the deprecated import is used by paramiko versions older than 2.9.5.
# See: https://github.com/paramiko/paramiko/pull/2039
warnings.filterwarnings('ignore', message='Blowfish has been ', category=UserWarning)
# TripleDES has been moved, but the deprecated import is used by paramiko versions older than 3.3.2 and 3.4.1.
# See: https://github.com/paramiko/paramiko/pull/2421
warnings.filterwarnings('ignore', message='TripleDES has been ', category=UserWarning)
import paramiko # pylint: disable=unused-import import paramiko # pylint: disable=unused-import
# paramiko and gssapi are incompatible and raise AttributeError not ImportError # paramiko and gssapi are incompatible and raise AttributeError not ImportError
# When running in FIPS mode, cryptography raises InternalError # When running in FIPS mode, cryptography raises InternalError

Loading…
Cancel
Save