Skip to content

subscriber.py receive requires an args.timeout but it is missing from positional or optional arguments #2633

@botscholar-scott

Description

@botscholar-scott

In which file did you encounter the issue?

subscriber.py

GoogleCloudPlatform/python-docs-samples/pubsub/cloud-client

Did you change the file? If so, how?

No

Describe the issue

I was following the directions here [1] to receive from a subscription I created in the emulator and it fails saying it has no args.timeout. I see no way to provide this or any code that would parse this even if provided.

[1] https://cloud.google.com/pubsub/docs/emulator

python subscriber.py my-project-id receive my-sub
Traceback (most recent call last):
File "subscriber.py", line 541, in
receive_messages(args.project_id, args.subscription_name, args.timeout)
AttributeError: 'Namespace' object has no attribute 'timeout'

python subscriber.py my-project-id receive my-sub timeout=5
usage: subscriber.py [-h]
project_id
{list_in_topic,list_in_project,create,create-push,delete,update,receive,receive-custom-attributes,receive-flow-control,receive-synchronously,receive-synchronously-with-lease,listen_for_errors}
...
subscriber.py: error: unrecognized arguments: timeout=5

Metadata

Metadata

Labels

api: pubsubIssues related to the Pub/Sub API.triage meI really want to be triaged.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