2013-03-21 29 views
2

我有一个问题,我想访问存储在我的谷歌云存储的数据,但我有一个错误,我不知道它来自哪里。从python应用程序访问谷歌存储

这里是我的代码:

DECORATOR = oauth2decorator_from_clientsecrets(
     CLIENT_SECRETS, 
     scope=[ 
       'https://www.googleapis.com/auth/devstorage.read_only', 
       ], 
     message=MISSING_CLIENT_SECRETS_MESSAGE) 
    http = DECORATOR.http() 
    service_cloud = build("storage", "v1beta1") 
    list_response = service_cloud.objects().list(bucket="directory_structure").execute(http=http) 

    params = {'directory_list':list_response['items']} 
    return self.render_template('directoryChoice.html', **params) 

,我收到错误消息是:

Traceback (most recent call last): 
File "/python27_runtime/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1529, in __call__ rv = self.router.dispatch(request, response) 
File "/python27_runtime/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher return route.handler_adapter(request, response) 
File "/python27_runtime/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1102, in __call__ return handler.dispatch() 
File "/base/data/home/apps/s~jba-gae-boilerplate/dev.366111306063368728/boilerplate/lib/basehandler.py", line 162, in dispatch webapp2.RequestHandler.dispatch(self) 
File "/python27_runtime/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 572, in dispatch return self.handle_exception(e, self.app.debug) 
File "/python27_runtime/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 570, in dispatch return method(*args, **kwargs) 
File "/base/data/home/apps/s~jba-gae-boilerplate/dev.366111306063368728/web/lib/oauth2client/appengine.py", line 469, in check_oauth return method(request_handler, *args, **kwargs) 
File "/base/data/home/apps/s~jba-gae-boilerplate/dev.366111306063368728/web/handlers.py", line 190, in get list_response = service_cloud.objects().list(bucket="jba_directory").execute(http=http) 
File "/base/data/home/apps/s~jba-gae-boilerplate/dev.366111306063368728/web/lib/oauth2client/util.py", line 120, in positional_wrapper return wrapped(*args, **kwargs) 
File "/base/data/home/apps/s~jba-gae-boilerplate/dev.366111306063368728/web/lib/apiclient/http.py", line 678, in execute raise HttpError(resp, content, uri=self.uri) 
HttpError: 
+1

你忘了粘贴错误的最后一行吗? – 2013-03-21 13:39:40

+0

不,这是我收到的。 – user1990088 2013-03-22 08:09:59

回答

0

一件事看起来有点奇怪:

在你的代码要上市directory_structure桶,但回溯引用jba_directory。有某种错误的匹配。也许在包装的装饰器或其他代码上面的代码片断你包括在这里?

相关问题