Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Vision raises TypeError: b'...' is not JSON serializable on Python 3 #2525

Copy link
Copy link

Description

@theacodes
Issue body actions

Simple reproducible case:

import io
import os

from google.cloud import vision

vision_client = vision.Client()

file_name = os.path.join(
    os.path.dirname(__file__),
    'resources/wakeupcat.jpg')

with io.open(file_name, 'rb') as image_file:
    image = vision_client.image(
        content=image_file.read())

labels = image.detect_labels()

print('Labels:')
for label in labels:
    print(label.description)

works fine on Python 2, fails on Python 3.

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

api: visionIssues related to the Cloud Vision API.Issues related to the Cloud Vision API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.