Skip to content

TypeError("'NoneType' object isn't iterable",) #80

@nasirxo

Description

@nasirxo

ERROR:picoweb:30.000 <HTTPRequest object at 3fffd830> <Stream object at 3fffd4a0> TypeError("'NoneType' object isn't iterable",)
Traceback (most recent call last):
File "/lib/picoweb/init.py", line 206, in _handle
TypeError: 'NoneType' object isn't iterable
{'ir': 'S'}

here is my code
`import picoweb

def qs_parse(qs):
parameters = {}
ampersandSplit = qs.split("&")
for element in ampersandSplit:
equalSplit = element.split("=")
parameters[equalSplit[0]] = equalSplit[1]
return parameters

app = picoweb.WebApp(name)

@app.route("/move")
def index(req, resp):
try:
cmd = {x[0] : x[1] for x in [x.split("=") for x in req.qs[1:].split("&") ]}
print(cmd)
'''
if cmd == 'F': robot.forward()
if cmd == 'B': robot.backward()
if cmd == 'L': robot.turnleft()
if cmd == 'R': robot.turnright()
if cmd == 'S': robot.stop()
'''
except: pass

@app.route("/action")
def index(req, resp):
try:
cmd = qs_parse(req.qs)['type']
if cmd == '1': robot.beep(20)
except: pass

import ulogging as logging
logging.basicConfig(level=logging.INFO)

app.run(host='0.0.0.0', port=80)

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions