Python Forum
how to avoid deprecation notice - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: how to avoid deprecation notice (/thread-41199.html)



how to avoid deprecation notice - merrittr - Nov-27-2023

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


RE: how to avoid deprecation notice - deanhystad - Nov-27-2023

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.


RE: how to avoid deprecation notice - snippsat - Nov-27-2023

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.


RE: how to avoid deprecation notice - rob101 - Nov-27-2023

(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.


RE: how to avoid deprecation notice - Larz60+ - Nov-27-2023

Snippsat said
Quote:breaking changes
.
I would take that to mean chnges that break version 3.6


RE: how to avoid deprecation notice - rob101 - Nov-27-2023

(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.