Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Subscription.pull() fails with KeyError #899

@campoy

Description

@campoy

Hi,

My code below fails with a KeyError coming from the library:

  sub = Subscription(SUBSCRIPTION_NAME, Topic(INCOMING_TOPIC_NAME))

  while True:
    try:
      msgs = sub.pull()
      ...
    except:
      msg = 'poll %s: %s' % (SUBSCRIPTION_NAME, traceback.format_exc())
      print msg

Fails with the message:

poll extractors: Traceback (most recent call last):
  File "main.py", line 46, in main
    msgs = sub.pull()
  File "/usr/local/lib/python2.7/dist-packages/gcloud/pubsub/subscription.py", line 176, in pull
    for info in response['receivedMessages']]
KeyError: 'receivedMessages'

This seems like a bug on the pubsub library code.

Metadata

Metadata

Assignees

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