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

KeyError: 'first_name' #22

Closed
Bergiu opened this issue Jul 19, 2017 · 1 comment
Closed

KeyError: 'first_name' #22

Bergiu opened this issue Jul 19, 2017 · 1 comment
Labels

Comments

@Bergiu
Copy link
Contributor

Bergiu commented Jul 19, 2017

When I run ncTelegram and click on a special chat ncTelegram crashes with this error:

  File "/usr/local/bin/nctelegram", line 93, in <module>
    ncTelegram.Telegram_ui(config_full)
  File "/usr/local/lib/python3.5/dist-packages/ncTelegram/__init__.py", line 91, in __init__
    self.main_loop.run()
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 278, in run
    self._run()
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 376, in _run
    self.event_loop.run()
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 682, in run
    self._loop()
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 719, in _loop
    self._watch_files[fd]()
  File "/usr/lib/python3/dist-packages/urwid/raw_display.py", line 393, in <lambda>
    event_loop, callback, self.get_available_raw_input())
  File "/usr/lib/python3/dist-packages/urwid/raw_display.py", line 493, in parse_input
    callback(processed, processed_codes)
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 403, in _update
    self.process_input(keys)
  File "/usr/lib/python3/dist-packages/urwid/main_loop.py", line 503, in process_input
    k = self._topmost_widget.keypress(self.screen_size, k)
  File "/usr/lib/python3/dist-packages/urwid/container.py", line 2269, in keypress
    key = w.keypress((mc,) + size[1:], key)
  File "/usr/local/lib/python3.5/dist-packages/ncTelegram/ui_chanwidget.py", line 195, in keypress
    key = super(ChanWidget, self).keypress(size, key)
  File "/usr/lib/python3/dist-packages/urwid/listbox.py", line 985, in keypress
    key = focus_widget.keypress((maxcol,),key)
  File "/usr/lib/python3/dist-packages/urwid/wimp.py", line 535, in keypress
    self._emit('click')
  File "/usr/lib/python3/dist-packages/urwid/widget.py", line 463, in _emit
    signals.emit_signal(self, name, self, *args)
  File "/usr/lib/python3/dist-packages/urwid/signals.py", line 264, in emit
    result |= self._call_callback(callback, user_arg, user_args, args)
  File "/usr/lib/python3/dist-packages/urwid/signals.py", line 294, in _call_callback
    return bool(callback(*args_to_pass))
  File "/usr/local/lib/python3.5/dist-packages/ncTelegram/ui_chanwidget.py", line 177, in chan_change
    self.Telegram_ui.msg_widget.get_history()
  File "/usr/local/lib/python3.5/dist-packages/ncTelegram/ui_msgwidget.py", line 60, in get_history
    self.print_msg(msg)
  File "/usr/local/lib/python3.5/dist-packages/ncTelegram/ui_msgwidget.py", line 147, in print_msg
    sender_reply = msg_reply['sender']['first_name']
KeyError: 'first_name'

Also ncTelegram doesn't start at all, if the chat is the newest in the history.
This error appears only in one chat.

Bergiu pushed a commit to Bergiu/ncTelegram that referenced this issue Jul 19, 2017
Nanoseb added a commit that referenced this issue Jul 19, 2017
@Nanoseb Nanoseb added the bug label Jul 19, 2017
@Nanoseb
Copy link
Owner

Nanoseb commented Jul 19, 2017

Thanks for reporting and fixing this!

@Nanoseb Nanoseb closed this as completed Jul 19, 2017
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

2 participants