I'm using the zeep
package to access some API on https, and on every connection it prints out a warning (to stderr):
Forcing soap:address location to HTTPS
Some searching I did turned up that the line responsible is this, which implies that this the result of the logging level of the module. Changing the log level seems to require editing this file.
This is a bad solution for me because I want to be able to turn this warning off at run time, because the app using this package will be a frozen app (an exe).
If that's relevant, these are the minimum lines required to display that warning (although obviously, the domain here is a fictional one, and so are the user and password):
import zeep
client = zeep.CachingClient('https://api.somedomain.com/Services/ApiService.svc?singleWsdl')
client.service.VerifyLogin('user', 'pass')
I know zeep
clients can be set to not force https, but I assume that would make the connection less secure? (after all, I'm passing usernames and passwords as clear text without https)
After a few days of research I've finally been able to solve this on my own. I didn't realize logging levels can be changed from imported modules. I added this line at the start of my code (after imports) and it fixed the issue:
import logging
logging.getLogger('zeep').setLevel(logging.ERROR)
Hope this helps other people that encounter the same problem
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With