tdryer / hangups

the first third-party instant messaging client for Google Hangouts
https://hangups.readthedocs.io/
MIT License
1.71k stars 191 forks source link

Conversation sort_timestamp is set to null by video hangout #130

Open zmoore opened 9 years ago

zmoore commented 9 years ago

Hangups used to work. Now I get this message about 1 minute after starting up. Don't know what causes it, but it's consistent since the last ubuntu update. I don't need to have a particular chat open for it to crash, as it happens even from the conversations list.

Traceback (most recent call last):
  File "/usr/local/bin/hangups", line 9, in <module>
    load_entry_point('hangups==0.2.9', 'console_scripts', 'hangups')()
  File "/usr/local/lib/python3.4/dist-packages/hangups-0.2.9-py3.4.egg/hangups/ui/__main__.py", line 864, in main
  File "/usr/local/lib/python3.4/dist-packages/hangups-0.2.9-py3.4.egg/hangups/ui/__main__.py", line 79, in __init__
  File "/usr/local/lib/python3.4/dist-packages/asyncio-3.4.3-py3.4.egg/asyncio/base_events.py", line 316, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.4/dist-packages/asyncio-3.4.3-py3.4.egg/asyncio/futures.py", line 275, in result
    raise self._exception
  File "/usr/local/lib/python3.4/dist-packages/asyncio-3.4.3-py3.4.egg/asyncio/tasks.py", line 234, in _step
    result = coro.throw(exc)
  File "/usr/local/lib/python3.4/dist-packages/hangups-0.2.9-py3.4.egg/hangups/client.py", line 122, in connect
  File "/usr/local/lib/python3.4/dist-packages/asyncio-3.4.3-py3.4.egg/asyncio/futures.py", line 386, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/local/lib/python3.4/dist-packages/asyncio-3.4.3-py3.4.egg/asyncio/tasks.py", line 287, in _wakeup
    value = future.result()
  File "/usr/local/lib/python3.4/dist-packages/asyncio-3.4.3-py3.4.egg/asyncio/futures.py", line 275, in result
    raise self._exception
  File "/usr/local/lib/python3.4/dist-packages/asyncio-3.4.3-py3.4.egg/asyncio/tasks.py", line 238, in _step
    result = next(coro)
  File "/usr/local/lib/python3.4/dist-packages/hangups-0.2.9-py3.4.egg/hangups/channel.py", line 204, in listen
  File "/usr/local/lib/python3.4/dist-packages/hangups-0.2.9-py3.4.egg/hangups/channel.py", line 355, in _longpoll_request
  File "/usr/local/lib/python3.4/dist-packages/hangups-0.2.9-py3.4.egg/hangups/channel.py", line 385, in _on_push_data
  File "/usr/local/lib/python3.4/dist-packages/hangups-0.2.9-py3.4.egg/hangups/event.py", line 50, in fire
  File "/usr/local/lib/python3.4/dist-packages/hangups-0.2.9-py3.4.egg/hangups/client.py", line 315, in _on_push_data
  File "/usr/local/lib/python3.4/dist-packages/hangups-0.2.9-py3.4.egg/hangups/event.py", line 50, in fire
  File "/usr/local/lib/python3.4/dist-packages/hangups-0.2.9-py3.4.egg/hangups/conversation.py", line 430, in _on_state_update
  File "/usr/local/lib/python3.4/dist-packages/hangups-0.2.9-py3.4.egg/hangups/conversation.py", line 444, in _on_client_event
  File "/usr/local/lib/python3.4/dist-packages/hangups-0.2.9-py3.4.egg/hangups/event.py", line 48, in fire
  File "/usr/local/lib/python3.4/dist-packages/hangups-0.2.9-py3.4.egg/hangups/ui/__main__.py", line 288, in _on_event
  File "/usr/local/lib/python3.4/dist-packages/hangups_urwid-1.2.2.dev0-py3.4.egg/urwid/monitored_list.py", line 496, in sort
    rval = super(MonitoredFocusList, self).sort(**kwargs)
  File "/usr/local/lib/python3.4/dist-packages/hangups_urwid-1.2.2.dev0-py3.4.egg/urwid/monitored_list.py", line 27, in call_modified_wrapper
    rval = fn(self, *args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/hangups-0.2.9-py3.4.egg/hangups/ui/__main__.py", line 287, in <lambda>
  File "/usr/local/lib/python3.4/dist-packages/hangups-0.2.9-py3.4.egg/hangups/ui/__main__.py", line 265, in last_modified
  File "/usr/local/lib/python3.4/dist-packages/hangups-0.2.9-py3.4.egg/hangups/conversation.py", line 303, in last_modified
  File "/usr/local/lib/python3.4/dist-packages/hangups-0.2.9-py3.4.egg/hangups/parsers.py", line 71, in from_timestamp
TypeError: unsupported operand type(s) for //: 'NoneType' and 'int'
Exception ignored in: Exception ignored in: 
tdryer commented 9 years ago

Looks like a conversation is having its timestamp changed to null for some reason. I'm not sure why this would happen consistently after a delay.

Can you enable the debug log (hangups -d) and send me the last log message (~/.cache/hangups/log/hangups.log) when it crashes?

zmoore commented 9 years ago

It turns out this only happens when a group conversation has a video call going. I didn't realize that there was a video call until I looked at hangouts. Sure enough, every time a video call starts or when hangups starts mid-videocall, there's a few seconds of delay and this error message appears.

tdryer commented 9 years ago

Thanks, I reproduced this and added a workaround. The workaround causes the sort order for the conversation to be temporarily incorrect, so I'll leave this issue open to address the root problem.

amit151993 commented 7 years ago

Why am i getting these errors while running the hangups?

Traceback (most recent call last): File "/usr/local/bin/hangups", line 9, in load_entry_point('hangups==0.4.2', 'console_scripts', 'hangups')() File "/usr/lib/python3/dist-packages/pkg_resources.py", line 351, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2363, in load_entry_point return ep.load() File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2088, in load entry = import(self.module_name, globals(),globals(), ['name']) File "", line 2237, in _find_and_load File "", line 2226, in _find_and_load_unlocked File "", line 1191, in _load_unlocked File "", line 1161, in _load_backward_compatible File "/usr/local/lib/python3.4/dist-packages/hangups-0.4.2-py3.4.egg/hangups/init.py", line 6, in File "", line 2237, in _find_and_load File "", line 2226, in _find_and_load_unlocked File "", line 1191, in _load_unlocked File "", line 1161, in _load_backward_compatible File "/usr/local/lib/python3.4/dist-packages/hangups-0.4.2-py3.4.egg/hangups/client.py", line 3, in File "/usr/local/lib/python3.4/dist-packages/asyncio/init.py", line 21, in from .base_events import * File "/usr/local/lib/python3.4/dist-packages/asyncio/base_events.py", line 18, in import concurrent.futures File "/usr/local/lib/python3.4/dist-packages/concurrent/futures/init.py", line 8, in from concurrent.futures._base import (FIRST_COMPLETED, File "/usr/local/lib/python3.4/dist-packages/concurrent/futures/_base.py", line 381 raise exception_type, self._exception, self._traceback ^ SyntaxError: invalid syntax