# Buggy code
def getUpdates(self, offset=None, limit=100, timeout=0, network_delay=0.2, **kwargs):
    """Use this method to receive incoming updates using long polling.

    Args:
      offset:
        Identifier of the first update to be returned. Must be greater by
        one than the highest among the identifiers of previously received
        updates. By default, updates starting with the earliest unconfirmed
        update are returned. An update is considered confirmed as soon as
        getUpdates is called with an offset higher than its update_id.
      limit:
        Limits the number of updates to be retrieved. Values between 1-100
        are accepted. Defaults to 100.
      timeout:
        Timeout in seconds for long polling. Defaults to 0, i.e. usual
        short polling.
      network_delay:
        Additional timeout in seconds to allow the response from Telegram
        to take some time when using long polling. Defaults to 2, which
        should be enough for most connections. Increase it if it takes very
        long for data to be transmitted from and to the Telegram servers.

    Returns:
        list[:class:`telegram.Update`]: A list of :class:`telegram.Update`
        objects are returned.

    Raises:
        :class:`telegram.TelegramError`

    """

    url = "{0}/getUpdates".format(self.base_url)

    data = {"timeout": timeout}

    if offset:
        data["offset"] = offset
    if limit:
        data["limit"] = limit

    urlopen_timeout = timeout + network_delay

    result = request.post(url, data, timeout=urlopen_timeout)

    if result:
        self.logger.debug("Getting updates: %s", [u["update_id"] for u in result])
    else:
        self.logger.debug("No new updates found.")

    return [Update.de_json(x) for x in result]


# Traceback (NetworkError)
Python 2.7.9 (default, Mar  8 2015, 00:52:26)
[GCC 4.9.2] on linux2
Type "copyright", "credits" or "license()" for more information.
import telegram
bot = telegram.Bot(token='123123:My_token')
print(bot.getMe())
{'username': u'My_bot', 'first_name': u'Flexget', 'last_name': '', 'type': '', 'id': 123123}
updates = bot.getUpdates()

Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
updates = bot.getUpdates()
File "/usr/local/lib/python2.7/dist-packages/telegram/bot.py", line 109, in decorator
result = func(self, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/telegram/bot.py", line 1215, in getUpdates
result = request.post(url, data, timeout=urlopen_timeout)
File "/usr/local/lib/python2.7/dist-packages/telegram/utils/request.py", line 83, in decorator
raise NetworkError('URLError: {0}'.format(error.reason))
NetworkError: URLError: [Errno 101] Network is unreachable
chat_id = bot.getUpdates()[-1].message.chat_id

Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
chat_id = bot.getUpdates()[-1].message.chat_id
File "/usr/local/lib/python2.7/dist-packages/telegram/bot.py", line 109, in decorator
result = func(self, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/telegram/bot.py", line 1215, in getUpdates
result = request.post(url, data, timeout=urlopen_timeout)
File "/usr/local/lib/python2.7/dist-packages/telegram/utils/request.py", line 83, in decorator
raise NetworkError('URLError: {0}'.format(error.reason))
NetworkError: URLError: [Errno 101] Network is unreachable


# Fixed code
def getUpdates(self, offset=None, limit=100, timeout=0, network_delay=5.0, **kwargs):
    """Use this method to receive incoming updates using long polling.

    Args:
      offset (Optional[int]):
        Identifier of the first update to be returned. Must be greater by  one than the highest
        among the identifiers of previously received updates. By default, updates starting with
        the earliest unconfirmed update are returned. An update is considered confirmed as soon
        as getUpdates is called with an offset higher than its update_id.
      limit (Optional[int]):
        Limits the number of updates to be retrieved. Values between 1-100 are accepted.
        Defaults to 100.
      timeout (Optional[int]):
        Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling.
      network_delay (Optional[float]):
        Additional timeout in seconds to allow the response from Telegram servers. This should
        cover network latency around the globe, SSL handshake and slowness of the Telegram
        servers (which unfortunately happens a lot recently - 2016-05-28). Defaults to 5.

    Returns:
        list[:class:`telegram.Update`]

    Raises:
        :class:`telegram.TelegramError`

    """

    url = "{0}/getUpdates".format(self.base_url)

    data = {"timeout": timeout}

    if offset:
        data["offset"] = offset
    if limit:
        data["limit"] = limit

    urlopen_timeout = timeout + network_delay

    result = request.post(url, data, timeout=urlopen_timeout)

    if result:
        self.logger.debug("Getting updates: %s", [u["update_id"] for u in result])
    else:
        self.logger.debug("No new updates found.")

    return [Update.de_json(x) for x in result]