Skip to content

Should we URL quote subscription names #1507

@dhermes

Description

@dhermes

@tseaver I tried to use

t = client.topic('foo')
s = t.subscription('bar with space')

and got a strange error. Should we forbid subscription names that don't adhere or manually escape them for users? I wrote a docstring edit but wanted to discuss before sending a PR

diff --git a/gcloud/pubsub/subscription.py b/gcloud/pubsub/subscription.py
index e3da8a0..8c54d39 100644
--- a/gcloud/pubsub/subscription.py
+++ b/gcloud/pubsub/subscription.py
@@ -26,7 +26,10 @@ class Subscription(object):
     https://cloud.google.com/pubsub/reference/rest/v1/projects.subscriptions

     :type name: string
-    :param name: the name of the subscription
+    :param name: the name of the subscription. Must start with a letter, and
+                 contain only letters, numbers, dashes, underscores, periods,
+                 tildes, plus or percent signs. It must be between 3 and 255
+                 characters in length, and it must not start with ``goog``.

     :type topic: :class:`gcloud.pubsub.topic.Topic`
     :param topic: the topic to which the subscription belongs..

Metadata

Metadata

Labels

api: pubsubIssues related to the Pub/Sub API.priority: p2Moderately-important priority. Fix may not be included in next release.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions