Python Forum
how to avoid deprecation notice
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to avoid deprecation notice
#1
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
Reply
#2
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.
Reply
#3
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.
Reply
#4
(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.
Sig:
>>> import this

The UNIX philosophy: "Do one thing, and do it well."

"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse

"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
Reply
#5
Snippsat said
Quote:breaking changes
.
I would take that to mean chnges that break version 3.6
Reply
#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.
Larz60+ likes this post
Sig:
>>> import this

The UNIX philosophy: "Do one thing, and do it well."

"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse

"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  PyPDF2 deprecation problem gowb0w 5 4,160 Sep-21-2023, 12:38 PM
Last Post: Pedroski55
  [notice] A new release of pip available: 22.3.1 -> 23.1.2 [notice] To update, run: C: GoldenHarvey 3 5,321 Jun-06-2023, 05:43 PM
Last Post: GoldenHarvey
  Will JoinableQueue.join() always notice the counter reaching 0? RobinVeer 1 769 Oct-07-2022, 09:28 AM
Last Post: Larz60+
  wrap_text with openpyxl. How to use documentation to resolve deprecation warning? curranjohn46 4 14,433 Oct-09-2019, 01:04 PM
Last Post: curranjohn46

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020