GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — pubsub fails if data key is not present · Issue #1480 · googleapis/google-cloud-python

pubsub fails if data key is not present #1480

New issue
Copy link
New issue
Copy link
Closed
Closed
pubsub fails if data key is not present#1480
Copy link
Assignees
tseaver
Labels
api: pubsubIssues related to the Pub/Sub API.

Description

@regner
regner
opened on Feb 17, 2016
Issue body actions

If a message is published with a string of 0 length (topic.publish( '', url=url, title=title)) when the message is received there is no data field in the message and a key error is thrown when trying to transform the message from the PubSub API representation.

https://github.com/GoogleCloudPlatform/gcloud-python/blob/master/gcloud/pubsub/message.py#L74

Traceback (most recent call last):
File "/en_notifications/en_notifications.py", line 51, in <module>
received = PS_SUBSCRIPTION.pull(max_messages=PULL_COUNT)
File "/usr/local/lib/python2.7/dist-packages/gcloud/pubsub/subscription.py", line 212, in pull
File "/usr/local/lib/python2.7/dist-packages/gcloud/pubsub/message.py", line 74, in from_api_repr
for info in response.get('receivedMessages', ())]
data = base64.b64decode(api_repr['data'])
KeyError: 'data'

Activity

  1. tseaver commented on Feb 17, 2016

    @tseaver
    tseaver
    on Feb 17, 2016
    Contributor
    More actions

    Thank you for the report!

  2. tseaver
    self-assigned this
    on Feb 17, 2016
  3. dhermes
    added
    api: pubsubIssues related to the Pub/Sub API.
    on Feb 17, 2016
  4. tseaver
    closed this as completedin #1481on Feb 17, 2016
  5. parthea
    added a commit that references this issue on Nov 24, 2025

    fix: Fix timeout default values (#1480)

    5c1652d
  6. parthea
    added 2 commits that reference this issue on Mar 6, 2026

    chore(deps): update dependency shapely to v2.0.1 (#1480)

    f4c3dd1

    chore: Add gcp resource name span attribute (#1480)

    02c0bbd
  7. parthea
    added a commit that references this issue on Apr 1, 2026

    fix: use `==` instead of `is` for timedelta type equality checks (#1480)

    ea7c66a
  8. parthea
    added a commit that references this issue on Sep 8, 2026

    docs: migrate code from googleapis/python-bigquery (#18303)

    23f9a74
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @tseaver
    tseaver

Labels

api: pubsubIssues related to the Pub/Sub API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.