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 — Can not "get_contents_as_*" when key is in a folder · Issue #354 · googleapis/google-cloud-python

Can not "get_contents_as_*" when key is in a folder #354

New issue
Copy link
New issue
Copy link
Closed
#364
Closed
Can not "get_contents_as_*" when key is in a folder#354
#364
Copy link
Assignees
tseaver
Labels
🚨This issue needs some love.api: storageIssues related to the Cloud Storage API.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
Milestone
Storage Stable

Description

@Fkawala
Fkawala
opened on Nov 7, 2014
Issue body actions

Warning : I might miss something fundamental in the "google storage" nomenclature !

The problem is as follows: when ones creates a key in a folder it is impossible to retrieve its data.
To code below reproduces the issue on version 0.02.2.

import time
from gcloud import storage
from gcloud.storage.demo import get_connection

c  = storage.demo.get_connection()
b = c.get_bucket('debug-gcloud-%d' % int(time.time()))
k = b.new_key("bare/my-new-file.txt")
k = set_contents_from_string("this is some dataaaaa!")
k = b.get_key("bare/my-new-file.txt")
print k.get_contents_as_string()

The error stack is presented below.
This error does not appear when the attribute name of the object key is url quoted with quote_plus from urlib.

Traceback (most recent call last):
  File "test_gcloud.py", line 12, in <module>
    k = b.get_key("bare/my-new-file.txt")
  File "/home/user/.virtualenvs/env/local/lib/python2.7/site-packages/gcloud/storage/bucket.py", line 83, in get_key
    response = self.connection.api_request(method='GET', path=key.path)
  File "/home/user/.virtualenvs/env/local/lib/python2.7/site-packages/gcloud/storage/connection.py", line 214, in api_request
    raise exceptions.NotFoundError(response, content)
  File "/home/user/.virtualenvs/env/local/lib/python2.7/site-packages/gcloud/storage/exceptions.py", line 17, in __init__
    self.message = 'GET %s returned a 404.' % (response.url)
  File "/home/user/.virtualenvs/env/local/lib/python2.7/site-packages/httplib2/__init__.py", line 1680, in __getattr__
    raise AttributeError, name
AttributeError: url

Activity

Next
  1. tseaver commented on Nov 7, 2014

    @tseaver
    tseaver
    on Nov 7, 2014
    Contributor
    More actions

    I just checked: the Object Naming spec does not disallow the / in names. See #165.

  2. Fkawala commented on Nov 7, 2014

    @Fkawala
    Fkawala
    on Nov 7, 2014
    Author
    More actions

    Would it be useful if I issue a PR with the fix I mentioned earlier ?

  3. tseaver commented on Nov 7, 2014

    @tseaver
    tseaver
    on Nov 7, 2014
    Contributor
    More actions

    @Fkawala yes, that would be great. Please follow the contributor guidelines, including the "Contributor License Agreement" section.

  4. tseaver
    added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    api: storageIssues related to the Cloud Storage API.
    on Nov 7, 2014
  5. tseaver commented on Nov 10, 2014

    @tseaver
    tseaver
    on Nov 10, 2014
    Contributor
    More actions

    @Fkawala I'll make this fix today (I need it to flesh out the example app I'm working on).

  6. Fkawala
    added a commit that references this issue on Nov 10, 2014

    Fixes googleapis#354

    This issue will close once commit ec9bf75 is merged into the 'master' branch.
    ec9bf75
  7. tseaver
    closed this as completedin #364on Nov 11, 2014
  8. tseaver
    added a commit that references this issue on Nov 11, 2014

    Merge pull request #364 from tseaver/354-support_slash_in_key_names

    This issue will close once commit bc8b1c4 is merged into the 'main' branch.
    bc8b1c4
  9. jgeewax
    modified the milestone: Storage Stable on Jan 30, 2015
  10. yoshi-automation
    added
    triage meI really want to be triaged.
    🚨This issue needs some love.
    on Apr 7, 2020
  11. JustinBeckwith
    assigned
    tseaver
    on Feb 1, 2021
  12. parthea
    added a commit that references this issue on Jun 4, 2023

    build(deps): bump requests from 2.28.1 to 2.31.0 in /synthtool/gcp/te…

    dc9c288
  13. 20 remaining items

  14. parthea
    added a commit that references this issue on Sep 18, 2025

    FIX: exclude google-cloud-bigquery==2.4.x from dependencies (#354)

    b4d3304
  15. parthea
    added 10 commits that reference this issue on Nov 22, 2025

    chore(deps): update dependency apache-beam to v2.31.0 (#354)

    4da8aac

    Bump mypy syntax version for generated code (#354)

    d52dfa9

    chore(main): release 2.7.1 (#354)

    42e29ce

    chore(deps): update all dependencies (#354)

    2ecfc52

    ci(python): fix path to requirements.txt in release script (#354)

    d36b6a5

    chore: Add proto-plus dependency for Python 3.13 (#356)

    8c97cb1

    fix(deps): require google-api-core>=1.32.0,>=2.8.0 (#354)

    c381da9

    chore: pin 'google-{api,cloud}-core' to allow 2.x versions (#354)

    4d6bf5b

    fix: fix bug with `yield` of empty list in tasklets (#354)

    8bb779f

    chore: pin 'google-{api,cloud}-core' to allow 2.x versions (#354)

    932c3de
  16. parthea
    added a commit that references this issue on Feb 20, 2026

    Fix: Ensure autogenerate_code_verifier defaults to True in from_clien…

    This issue will close once commit f41f891 is merged into the 'main' branch.
    f41f891
  17. parthea
    added a commit that references this issue on Mar 2, 2026

    chore(python): exclude path in renovate.json [autoapprove] (#354)

    c7df98b
  18. parthea
    added 2 commits that reference this issue on Mar 9, 2026

    build(deps): bump pygments from 2.13.0 to 2.15.0 in /.kokoro (#354)

    8777d25

    chore(main): release 3.0.1 (#354)

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

Metadata

Metadata

Assignees

  • @tseaver
    tseaver

Labels

🚨This issue needs some love.api: storageIssues related to the Cloud Storage 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

    • Storage Stable

    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.