title: http login to router using python and requests module getting exception
body: <p>When I try to log in to my router it works fine but when the password or username is wrong I get the exception. How to handle this exception?</p>
  
  <pre><code>from requests.auth import HTTPBasicAuth
  import requests
  
  def hts():
      url = 'http://192.168.1.1/'
      name =  'username'
      passw = 'password'
      auth = HTTPBasicAuth(name,passw)
      r = requests.get(url,  auth=auth)
      try:
          if r:
           print(r.text)
          else:
           print("not found")
      except requests.exceptions.ContentDecodingError as e:
             print('wrong password')
  
    hts()
  </code></pre>
  
  <p>here is the error</p>
  
  <pre><code>raise ContentDecodingError(e)
  requests.exceptions.ContentDecodingError: ('Received response with content-encoding: 
      gzip, but failed to decode it.', error('Error -3 while decompressing data: incorrect
      header check',))    
  </code></pre>