watchforstock / evohome-client

Python client to access the Evohome web service
Apache License 2.0
88 stars 52 forks source link

No handlers could be found for logger "requests.packages.urllib3.connectionpool" #39

Closed sdevoogt closed 6 years ago

sdevoogt commented 6 years ago

Using the EvohomeClient2 each time gives me the error message: No handlers could be found for logger "requests.packages.urllib3.connectionpool" before outputting real output values. I'm using the Evohomeclient in another python script that should generate a clean single value that is in its turn being used in a tool to graph the output each 5 minutes. I suspect that this error message is rendering the output of the calling python script to be more than a single value. I want to resolve this error message to be sure this is the problem keeping me from generating good values for the graph.

Is this something I can resolve in my calling script or is this something that has to be resolved in the EvohomeClient2-code? My Python-knowlegde is kind of low for the moment and it seems I can't figure this out with the available info Google provides me about this kind of error.

Can somebody point me in the right direction?

watchforstock commented 6 years ago

The answer on this page: https://stackoverflow.com/questions/44188270/no-handlers-could-be-found-for-logger suggests that you add the following code to the start of your script which should create a default logger:

import logging
logging.basicConfig()

Can you try that and see if it removes the warning?

sdevoogt commented 6 years ago

This did not make any difference but I started digging some more and found that this code kills the message:

import logging

logger = logging.getLogger("requests.packages.urllib3.connectionpool")
nullHandler = logging.NullHandler()
logger.addHandler(nullHandler)

So problem solved for me. Thanks for pointing me in the direction and for developing EvohomeClient!