Python Forum
Warning / Error handling in python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Warning / Error handling in python
#1
I am using netmiko on my ubuntu 12.04 to SSH into one of my router. I am able to successfully SSH into the router, however along with my output I get below warning/error -

john@lab:~$ sudo python t3.py
/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
utils.DeprecatedIn23,

Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES manual administratively down down
FastEthernet1/0 198.51.100.5 YES manual up up

I know that I have to update to new Linux OS version, however, can someone help me on how I can just store this warning/error and not let it interfere with my output.

I did try using the warning module, but no luck-

with warnings.catch_warnings():
warnings.simplefilter("ignore")
warnings.warn("deprecated", DeprecationWarning)
Reply


Messages In This Thread
Warning / Error handling in python - by Prarthana_12 - Feb-08-2019, 04:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Calculating Average with Error Handling mikasa 7 620 May-07-2024, 07:48 AM
Last Post: snippsat
Star python exception handling handling .... with traceback mg24 3 1,348 Nov-09-2022, 07:29 PM
Last Post: Gribouillis
  Help needed with a "for loop" + error handling tamiri 2 2,698 May-27-2022, 12:21 PM
Last Post: tamiri
  Handling pdf files with python. fuzzin 1 1,309 Jan-19-2022, 02:24 PM
Last Post: ThiefOfTime
  TicTacToe Game Add Exception Handling and Warning Function ShaikhShaikh 5 2,503 Nov-03-2021, 05:02 PM
Last Post: deanhystad
  Handling Python Fatal Error richajain1785 7 6,108 Oct-14-2021, 01:34 PM
Last Post: Tails86
  Handling multi-input/output audio in python bor1904 4 3,677 Nov-04-2020, 08:25 AM
Last Post: CHLOVRL
  Error Handling JarredAwesome 5 3,061 Oct-17-2020, 12:41 AM
Last Post: JarredAwesome
  Python Requests package: Handling xml response soumyarani 1 2,232 Sep-14-2020, 11:41 AM
Last Post: buran
  Handling Multiple USB ports in Python samalpramod 0 4,527 Aug-01-2020, 07:40 PM
Last Post: samalpramod

Forum Jump:

User Panel Messages

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