Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NoneType' object has no attribute 'getData' #690

Closed
anildewani opened this issue Mar 18, 2015 · 3 comments
Closed

AttributeError: 'NoneType' object has no attribute 'getData' #690

anildewani opened this issue Mar 18, 2015 · 3 comments
Labels

Comments

@anildewani
Copy link

Hello, i'm unable to run the sample app code provided from the wiki
Following is the error i get immediately after i run the python script.

No handlers could be found for logger "yowsup.stacks.yowstack"
Traceback (most recent call last):
File "run.py", line 31, in
stack.loop() #this is the program mainloop
File "/Library/Python/2.7/site-packages/yowsup/stacks/yowstack.py", line 170, in loop
asyncore.loop(_args, *_kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/asyncore.py", line 216, in loop
poll_fun(timeout, map)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/asyncore.py", line 156, in poll
read(obj)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/asyncore.py", line 87, in read
obj.handle_error()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/asyncore.py", line 83, in read
obj.handle_read_event()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/asyncore.py", line 449, in handle_read_event
self.handle_read()
File "/Library/Python/2.7/site-packages/yowsup/layers/network/layer.py", line 48, in handle_read
self.receive(data)
File "/Library/Python/2.7/site-packages/yowsup/layers/network/layer.py", line 55, in receive
self.toUpper(data)
File "/Library/Python/2.7/site-packages/yowsup/layers/init.py", line 55, in toUpper
self.upper.receive(data)
File "/Library/Python/2.7/site-packages/yowsup/layers/stanzaregulator/layer.py", line 28, in receive
self.processReceived()
File "/Library/Python/2.7/site-packages/yowsup/layers/stanzaregulator/layer.py", line 48, in processReceived
self.toUpper(oneMessageData)
File "/Library/Python/2.7/site-packages/yowsup/layers/__init
.py", line 55, in toUpper
self.upper.receive(data)
File "/Library/Python/2.7/site-packages/yowsup/layers/auth/layer_crypt.py", line 63, in receive
self.toUpper(payload)
File "/Library/Python/2.7/site-packages/yowsup/layers/__init
.py", line 55, in toUpper
self.upper.receive(data)
File "/Library/Python/2.7/site-packages/yowsup/layers/coder/layer.py", line 35, in receive
self.toUpper(node)
File "/Library/Python/2.7/site-packages/yowsup/layers/__init
.py", line 55, in toUpper
self.upper.receive(data)
File "/Library/Python/2.7/site-packages/yowsup/layers/logger/layer.py", line 14, in receive
self.toUpper(data)
File "/Library/Python/2.7/site-packages/yowsup/layers/__init
.py", line 55, in toUpper
self.upper.receive(data)
File "/Library/Python/2.7/site-packages/yowsup/layers/__init
.py", line 160, in receive
s.receive(data)
File "/Library/Python/2.7/site-packages/yowsup/layers/init.py", line 101, in receive
recv(node)
File "/Library/Python/2.7/site-packages/yowsup/layers/protocol_messages/layer.py", line 20, in recvMessageStanza
entity = TextMessageProtocolEntity.fromProtocolTreeNode(node)
File "/Library/Python/2.7/site-packages/yowsup/layers/protocol_messages/protocolentities/message_text.py", line 38, in fromProtocolTreeNode
entity.setBody(node.getChild("body").getData())
AttributeError: 'NoneType' object has no attribute 'getData'

@bmutinda
Copy link

It mostly happens when the message is encrypted.

import the YowAxolotlLayer like this

from yowsup.layers.axolotl import YowAxolotlLayer

Then Add YowAxolotlLayer in your layers stack like this before you broadcast a connect event.

layers = (
        EchoLayer,
        (YowAuthenticationProtocolLayer, YowMessagesProtocolLayer, YowReceiptProtocolLayer, YowAckProtocolLayer),
        YowAxolotlLayer,
    ) + YOWSUP_CORE_LAYERS

@tgalal
Copy link
Owner

tgalal commented Apr 19, 2015

@mutindaz thanks!

@tgalal tgalal added the faq label Apr 19, 2015
@tgalal tgalal closed this as completed Apr 19, 2015
@get2abhi
Copy link

Problem solved. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants