ironman5366 / W.I.L.L

A python written personal assistant
https://willbeddow.com
MIT License
377 stars 58 forks source link

Error in intent.py: intent.parse is returning None #6

Closed brenttaylor closed 8 years ago

brenttaylor commented 8 years ago

You're using a lot of very broad exception handling throughout the application (which is not a good thing) and is making this rather difficult to debug. I believe I have all modules required installed (I'm working on a requirements.txt for pip freeze) however nothing worked and I kept getting the error "'NoneType' object has no attribute 'keys'" via the log with no other information, not even a line number.

By removing the try/catch block at lines 55-87 in main.py (though the code within the block was left in tact) I was able to at least figure out what's going on. Here's the traceback:

127.0.0.1 - - [25/Feb/2016 17:53:29] "GET /?context=command&command=Test HTTP/1.1" 500 - Traceback (most recent call last): File "C:\Users\btayl\Projects\WILL.git\env\lib\site-packages\flask\app.py", line 1836, in __call__ return self.wsgi_app(environ, start_response) File "C:\Users\btayl\Projects\WILL.git\env\lib\site-packages\flask\app.py", line 1820, in wsgi_app response = self.make_response(self.handle_exception(e)) File "C:\Users\btayl\Projects\WILL.git\env\lib\site-packages\flask\app.py", line 1403, in handle_exception reraise(exc_type, exc_value, tb) File "C:\Users\btayl\Projects\WILL.git\env\lib\site-packages\flask\app.py", line 1817, in wsgi_app response = self.full_dispatch_request() File "C:\Users\btayl\Projects\WILL.git\env\lib\site-packages\flask\app.py", line 1477, in full_dispatch_request rv = self.handle_user_exception(e) File "C:\Users\btayl\Projects\WILL.git\env\lib\site-packages\flask\app.py", line 1381, in handle_user_exception reraise(exc_type, exc_value, tb) File "C:\Users\btayl\Projects\WILL.git\env\lib\site-packages\flask\app.py", line 1475, in full_dispatch_request rv = self.dispatch_request() File "C:\Users\btayl\Projects\WILL.git\env\lib\site-packages\flask\app.py", line 1461, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "C:\Users\btayl\Projects\WILL.git\main.py", line 80, in main if parsed.keys()[0]=="execute": AttributeError: 'NoneType' object has no attribute 'keys'

It looks like the call to "intent.parse" on line 77 is returning None. It's possible I'm missing a module that needs to be installed, but as mentioned, due to the over reaching exception handling I'm not getting so much as an error that a module can't be found.

Here's what I've got so far (note, some of these are dependencies for other modules, such as flask):

Anything missing?

ironman5366 commented 8 years ago

Not that I can think of at the moment. The problem is that test isn't recognized. I really need to add handleling for this but I keep forgetting over and over. That's just the breaking point in the code where an unrecognized command raises an error.

ironman5366 commented 8 years ago

Fixed with https://github.com/ironman5366/W.I.L.L/commit/59c8683cee1ae725dc5b6cdc5de551f877aa4748