Skip to content

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

Description

@theacodes

Simple reproducible case:

importioimportosfromgoogle.cloudimportvisionvision_client=vision.Client()
file_name=os.path.join(
os.path.dirname(__file__),
'resources/wakeupcat.jpg')
withio.open(file_name, 'rb') asimage_file:
image=vision_client.image(
content=image_file.read())
labels=image.detect_labels()
print('Labels:')
forlabelinlabels:
print(label.description)

works fine on Python 2, fails on Python 3.

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions