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

Object of type 'bytes' is not JSON serializable #91

Closed
salehinRafi opened this issue May 26, 2017 · 1 comment
Closed

Object of type 'bytes' is not JSON serializable #91

salehinRafi opened this issue May 26, 2017 · 1 comment

Comments

@salehinRafi
Copy link

salehinRafi commented May 26, 2017

I encounter this problem when I try to follow messenger.py example. I try use Bottle and Flask. The Same problem occurs.

**o.__class__.__name__)
   TypeError: Object of type 'bytes' is not JSON serializable**

When I change this line 88 in pywit/examples/messenger.py code as below::-

data = {
        'recipient': {'id': sender_id},
        'message': {'text': text.decode('utf-8')}
    }

The problem is resolved.

I use ngrok, virtualenv as my environment development.

@PineLover
Copy link

original was

data = {
'recipient': {'id': sender_id},
'message': {'text': text}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants