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 — Should we URL quote subscription names · Issue #1507 · googleapis/google-cloud-python

Should we URL quote subscription names #1507

New issue
Copy link
New issue
Copy link
Closed
Closed
Should we URL quote subscription names#1507
Copy link
Assignees
lukesneeringer
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.

Description

@dhermes
dhermes
opened on Feb 20, 2016
Issue body actions

@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..

Activity

  1. dhermes
    added
    type: questionRequest for information or clarification. Not an issue.
    api: pubsubIssues related to the Pub/Sub API.
    on Feb 20, 2016
  2. tseaver commented on Mar 8, 2016

    @tseaver
    tseaver
    on Mar 8, 2016
    Contributor
    More actions

    I'm assuming you mean URL quoting?. I'd prefer that we just document the expected format, preferably by pointing to the API docs (I looked at project.subscriptions and project.subscriptions.create, and couldn't find the constraint specified).

  3. dhermes commented on Mar 9, 2016

    @dhermes
    dhermes
    on Mar 9, 2016
    ContributorAuthor
    More actions

    👍 Yes I meant that, sorry.

  4. dhermes
    changed the title [-]Should we HTML encode subscription names[/-] [+]Should we URL quote subscription names[/+] on Mar 9, 2016
  5. dhermes commented on Mar 9, 2016

    @dhermes
    dhermes
    on Mar 9, 2016
    ContributorAuthor
    More actions

    The constraint I mentioned is from the topics.create doc. Also just searching for 255 in the discovery doc turns up lots of mentions.

  6. tseaver commented on Mar 9, 2016

    @tseaver
    tseaver
    on Mar 9, 2016
    Contributor
    More actions

    Hmm, I didn't look at the "Try It!" section for specification, silly me. subscriptions.create has it, too!

  7. tseaver commented on Mar 9, 2016

    @tseaver
    tseaver
    on Mar 9, 2016
    Contributor
    More actions

    Anyway, I'm still -1 on DWIMing the invalid-name-with-spaces to the urlquoted form. Maybe we can Zawinski the names ahead of time (of course, then we have to worry about drift between our regex and the backend's constraints).

  8. dhermes commented on Mar 9, 2016

    @dhermes
    dhermes
    on Mar 9, 2016
    ContributorAuthor
    More actions

    Cool. At the very least we should update the docstrings

  9. lukesneeringer
    added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Apr 19, 2017
  10. lukesneeringer commented on Aug 8, 2017

    @lukesneeringer
    lukesneeringer
    on Aug 8, 2017
    Contributor
    More actions

    Hello! :-)
    First, a mea culpa; I have not done as good of a job at keeping up with issues as I should have. If you are getting this (I admit it) cut and paste, it is likely because your issue sat for too long.

    In this case, I have been in the process of making a radical update to the PubSub library (#3637) to add significant performance improvements and a new surface, which we hope to launch soon. As such, I am clearing out issues on the old library. It is my sincere goal to do a better job of being on top of issues in the future.

    As the preceding paragraph implies, I am closing this issue. If the revamped library does not solve your issue, however, please feel free to reopen.

    Thanks!

  11. lukesneeringer
    closed this as completedon Aug 8, 2017
  12. JustinBeckwith
    assigned
    lukesneeringer
    on Feb 1, 2021
  13. parthea
    added 2 commits that reference this issue on Nov 24, 2025

    chore(deps): bump cryptography from 37.0.4 to 38.0.3 in /.kokoro (#1507)

    951818a

    chore(main): release 2.30.0 (#1507)

    11b1f4e
  14. parthea
    added 3 commits that reference this issue on Mar 6, 2026

    chore(main): release 3.7.0 (#1507)

    487b58c

    bug: fixes discrepancy btwn python-api-core & bigquery re object defa… (

    ce568bc

    docs: update the documentation of move_blob function (#1507)

    3246d6c
  15. parthea
    added a commit that references this issue on Apr 1, 2026

    chore: allow PRECEDING and FOLLOWING to appear on both side of BETWEE…

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

Metadata

Metadata

Assignees

  • @lukesneeringer
    lukesneeringer

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

    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.