Skip to content

Pubsub.list_topics fails when there are no topics #1439

@dhermes

Description

@dhermes

Offending line. Reproduce via:

client = pubsub.Client()
>>> client.list_topics()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "gcloud/pubsub/client.py", line 80, in list_topics
    for resource in resp['topics']]
KeyError: 'topics'

@tseaver ISTM we should locate all instances where we assume a key is present and just protect against this. The time between releases behooves us to be "protective" of users. (I realize that we've usually done it this way based on documented outputs.)

Metadata

Metadata

Assignees

Labels

api: pubsubIssues related to the Pub/Sub 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