Skip to content

JSON error when trying to send Emoji on Python 3.4 #80

@salmiakki

Description

@salmiakki

When I try to send an Emoji using the line from the docs (more or less) I get the following:

    bot.sendMessage(chat_id=MY_CHAT_ID, text=telegram.Emoji.PILE_OF_POO)
  File "C:\Python34\lib\site-packages\telegram\bot.py", line 126, in decorator
    result = func(self, *args, **kwargs)
  File "C:\Python34\lib\site-packages\telegram\bot.py", line 158, in decorator
    result = request.post(url, data)
  File "C:\Python34\lib\site-packages\telegram\utils\request.py", line 88, in post
    data = json.dumps(data)
  File "C:\Python34\lib\json\__init__.py", line 230, in dumps
    return _default_encoder.encode(obj)
  File "C:\Python34\lib\json\encoder.py", line 192, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "C:\Python34\lib\json\encoder.py", line 250, in iterencode
    return _iterencode(o, 0)
  File "C:\Python34\lib\json\encoder.py", line 173, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: b'\xf0\x9f\x92\xa9' is not JSON serializable

This issue might be related to issue #72.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy