pablo/huawei-modem-python-api-client

No handlers could be found for logger "huaweisms.api.webserver"

Closed this issue · 2 comments

Hi, I'm trying to use the api for a personal project and I have run into an issue.
I have my rpi update to the latest official release and the api is also updated to v 1.0.9

Here is a snapshot of the error I am getting. Note: I added in a print statement for the token.
I would really appreciate some assistance as I am only a noob with python. Thank-you

Returned msg after code executed:
No handlers could be found for logger "huaweisms.api.webserver"
{'type': 'response', 'response': {u'SesInfo': u'SessionID=+xM3wVclSzX0+no96LTkVG+ESdhvg3AQtx6CcxwWDS6zz/E9eaKUczA/MQN1YoGuc+F2a1Du3rVpSVQ2lJRGU+rL1XRPZ9PzBMEZhaap8r/xXcrZR1FHAbKmeT/DqETP', u'TokInfo': u'RIYBy19K1/drOzCcmp/rC191uQ2Sqm02'}}
+xM3wVclSzX0+no96LTkVG+ESdhvg3AQtx6CcxwWDS6zz/E9eaKUczA/MQN1YoGuc+F2a1Du3rVpSVQ2lJRGU+rL1XRPZ9PzBMEZhaap8r/xXcrZR1FHAbKmeT/DqETP
Traceback (most recent call last):
File "CmdRequest.py", line 42, in
ctx = get_session()
File "CmdRequest.py", line 38, in get_session
lgn = user.login(ctx, user_name, password)
File "/usr/local/lib/python2.7/dist-packages/huaweisms/api/user.py", line 40, in login
password_value = b64_sha256(user_name + b64_sha256(password) + ctx.login_token)
TypeError: coercing to Unicode: need string or buffer, NoneType found

Sorry, I should have included this... as this is the code that is invoking the module:

def get_session():
ctx = ApiCtx()
token = webserver.SesTokInfo()

token = webserver.get_session_token_info()

    print (token)
    ctx.session_id = token['response']['SesInfo'].split("=")[1]
    print (ctx.session_id)
    ctx.token = token['response']['TokInfo']
    lgn = user.login(ctx, user_name, password)

pprint(lgn)

    return ctx
pablo commented

Hi! I don't think python 2.7 is supported. Please upgrade to Python 3.6 to get it to work.