Python Forum

Full Version: how to avoid deprecation notice
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Just wondering if there is a switch to stop a deprecation notice like the one below?


(env) [root@RHEL8-20230921 pyeztest]# ./jnprtest.py
/home/serveradmin/code/python/pyeztest/env/lib64/python3.6/site-packages/paramiko/transport.py:32: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.6.
from cryptography.hazmat.backends import default_backend
Move from Python 3.6 to something newer? Install an older version of cryptography? Were you looking for a different answer? You could disable the warning, but next time you update cryptography your program won't run.
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
If not work use pip install shutup
import shutup
shutup.please()
I guess there is reason that still use Python 3.6,or should try to make it work with newer version.
There has been no big breaking changes since the move from 2 to 3.
(Nov-27-2023, 09:24 PM)snippsat Wrote: [ -> ]There has been no big breaking changes since the move from 2 to 3.

I would argue that there has been one significant and very useful change which came about (I believe) with v3.6, namely the introduction of f-strings, but that's just MHO.
Snippsat said
Quote:breaking changes
.
I would take that to mean chnges that break version 3.6
(Nov-27-2023, 11:01 PM)Larz60+ Wrote: [ -> ]I would take that to mean chnges that break version 3.6

Ah... yes, I think that could very well be the case, now that you point it out and the meaning became lost in translation. My intention was not to undermine snippsat in any way, you understand.