tgalal / yowsup

The WhatsApp lib
GNU General Public License v3.0
7.08k stars 2.23k forks source link

Error sending audio from demo client #1054

Open jroman opened 9 years ago

jroman commented 9 years ago

Hi there:

once in the demo-cli and loged it, after typing

/audio send nnnnn path_to_audio_file

I get this error:

Traceback (most recent call last):
  File "./yowsup-cli", line 323, in <module>
    if not parser.process():
  File "./yowsup-cli", line 227, in process
    self.startCmdline()
  File "./yowsup-cli", line 255, in startCmdline
    stack.start()
  File "./yowsup/demos/cli/stack.py", line 25, in start
    self.stack.loop(timeout = 0.5, discrete = 0.5)
  File "./yowsup/stacks/yowstack.py", line 187, in loop
    asyncore.loop(*args, **kwargs)
  File "/usr/lib/python2.7/asyncore.py", line 216, in loop
    poll_fun(timeout, map)
  File "/usr/lib/python2.7/asyncore.py", line 156, in poll
    read(obj)
  File "/usr/lib/python2.7/asyncore.py", line 87, in read
    obj.handle_error()
  File "/usr/lib/python2.7/asyncore.py", line 83, in read
    obj.handle_read_event()
  File "/usr/lib/python2.7/asyncore.py", line 449, in handle_read_event
    self.handle_read()
  File "./yowsup/layers/network/layer.py", line 86, in handle_read
    self.receive(data)
  File "./yowsup/layers/network/layer.py", line 94, in receive
    self.toUpper(data)
  File "./yowsup/layers/__init__.py", line 59, in toUpper
    self.__upper.receive(data)
  File "./yowsup/layers/stanzaregulator/layer.py", line 28, in receive
    self.processReceived()
  File "./yowsup/layers/stanzaregulator/layer.py", line 48, in processReceived
    self.toUpper(oneMessageData)
  File "./yowsup/layers/__init__.py", line 59, in toUpper
    self.__upper.receive(data)
  File "./yowsup/layers/auth/layer_crypt.py", line 63, in receive
    self.toUpper(payload)
  File "./yowsup/layers/__init__.py", line 59, in toUpper
    self.__upper.receive(data)
  File "./yowsup/layers/coder/layer.py", line 35, in receive
    self.toUpper(node)
  File "./yowsup/layers/__init__.py", line 59, in toUpper
    self.__upper.receive(data)
  File "./yowsup/layers/logger/layer.py", line 14, in receive
    self.toUpper(data)
  File "./yowsup/layers/__init__.py", line 59, in toUpper
    self.__upper.receive(data)
  File "./yowsup/layers/axolotl/layer.py", line 126, in receive
    self.toUpper(protocolTreeNode)
  File "./yowsup/layers/__init__.py", line 59, in toUpper
    self.__upper.receive(data)
  File "./yowsup/layers/__init__.py", line 169, in receive
    s.receive(data)
  File "./yowsup/layers/__init__.py", line 101, in receive
    if not self.processIqRegistry(node):
  File "./yowsup/layers/__init__.py", line 136, in processIqRegistry
    successClbk(protocolTreeNode, originalIq)
  File "./yowsup/layers/protocol_media/layer.py", line 80, in onRequestUploadSuccess
    self.toUpper(ResultRequestUploadIqProtocolEntity.fromProtocolTreeNode(resultNode))
  File "./yowsup/layers/__init__.py", line 59, in toUpper
    self.__upper.receive(data)
  File "./yowsup/layers/interface/interface.py", line 95, in receive
    if not self.processIqRegistry(entity):
  File "./yowsup/layers/interface/interface.py", line 74, in processIqRegistry
    successClbk(entity, originalIq)
  File "./yowsup/demos/cli/layer.py", line 489, in <lambda>
    successFn = lambda successEntity, originalEntity: self.onRequestUploadResult(jid, path, successEntity, originalEntity)
  File "./yowsup/demos/cli/layer.py", line 682, in onRequestUploadResult
    resultRequestUploadIqProtocolEntity.getIp(), caption)
  File "./yowsup/demos/cli/layer.py", line 666, in doSendAudio
    self.toLower(entity)
  File "./yowsup/layers/__init__.py", line 63, in toLower
    self.__lower.send(data)
  File "./yowsup/layers/__init__.py", line 173, in send
    s.send(data)
  File "./yowsup/layers/__init__.py", line 111, in send
    send(entity)
  File "./yowsup/layers/protocol_media/layer.py", line 40, in sendMessageEntity
    self.entityToLower(entity)
  File "./yowsup/layers/__init__.py", line 115, in entityToLower
    self.toLower(entity.toProtocolTreeNode())
  File "./yowsup/layers/__init__.py", line 63, in toLower
    self.__lower.send(data)
  File "./yowsup/layers/axolotl/layer.py", line 109, in send
    self.toLower(node)
  File "./yowsup/layers/__init__.py", line 63, in toLower
    self.__lower.send(data)
  File "./yowsup/layers/logger/layer.py", line 8, in send
    logger.debug("tx:\n%s" % ldata)
  File "./yowsup/structs/protocoltreenode.py", line 81, in __str__
    return self.toString() 
  File "./yowsup/structs/protocoltreenode.py", line 73, in toString
    out += c.toString()
  File "./yowsup/structs/protocoltreenode.py", line 53, in toString
    out+= " "+key+'="'+val+'"'
TypeError: cannot concatenate 'str' and 'NoneType' objects

Any idea?

Thanks

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

jlguardi commented 8 years ago

Same issue. Some news?

jlguardi commented 8 years ago

In my case, it is due to unrecognized file format (by my Ubuntu but not by whatsapp). Fixed in #1338.