This repository has been archived on 2025-07-31 . You can view files and clone it, but cannot push or open issues or pull requests.
edc655bae779ed03123454a3b2edd5de8e9058d8
IndexError: list index out of range
bug
When the returned `short_name` is null, `fbchat` throws an exception: ```python File "/usr/local/lib/python2.7/site-packages/fbchat/client.py", line 792, in fetchThreadList return [graphql_to_thread(node) for node in j['viewer']['message_threads']['nodes']] File "/usr/local/lib/python2.7/site-packages/fbchat/graphql.py", line 193, in graphql_to_thread last_name=user.get('name').split(user.get('short_name'),1)[1].strip(), IndexError: list index out of range ``` This commit fixes that scenario by accessing the last item in the list via `.pop()` instead of via `[1]`
fbchat: Facebook Chat (Messenger) for Python ============================================ .. image:: https://img.shields.io/badge/license-BSD-blue.svg :target: LICENSE.txt :alt: License: BSD .. image:: https://img.shields.io/badge/python-2.7%2C%203.4%2C%203.5%2C%203.6-blue.svg :target: https://pypi.python.org/pypi/fbchat :alt: Supported python versions: 2.7, 3.4, 3.5 and 3.6 .. image:: https://readthedocs.org/projects/fbchat/badge/?version=master :target: https://fbchat.readthedocs.io :alt: Documentation Facebook Chat (`Messenger <https://www.facebook.com/messages/>`__) for Python. This project was inspired by `facebook-chat-api <https://github.com/Schmavery/facebook-chat-api>`__. **No XMPP or API key is needed**. Just use your email and password. Go to `Read the Docs <https://fbchat.readthedocs.io>`__ to see the full documentation, or jump right into the code by viewing the `examples <examples>`__ Installation: .. code-block:: console $ pip install fbchat Maintainer ---------- - Mads Marquart / `@madsmtm <https://github.com/madsmtm>`__ - Taehoon Kim / `@carpedm20 <http://carpedm20.github.io/about/>`__
Description
Languages
Python
100%