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

Commit df32b6b

Browse filesBrowse files
authored
Adds explicit decode for Python 3 (GoogleCloudPlatform#2383)
1 parent c3fa125 commit df32b6b
Copy full SHA for df32b6b

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎iot/api-client/mqtt_example/cloudiot_mqtt_example.py

Copy file name to clipboardExpand all lines: iot/api-client/mqtt_example/cloudiot_mqtt_example.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def on_publish(unused_client, unused_userdata, unused_mid):
116116

117117
def on_message(unused_client, unused_userdata, message):
118118
"""Callback when the device receives a message on a subscription."""
119-
payload = str(message.payload)
119+
payload = str(message.payload.decode('utf-8'))
120120
print('Received message \'{}\' on topic \'{}\' with Qos {}'.format(
121121
payload, message.topic, str(message.qos)))
122122

0 commit comments

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