相关疑难解决方法(0)

使用blobstore.create_gs_key创建的BlobKey中的BlobInfo对象

我正在将代码从不赞成使用的文件api转换掉。

我有以下代码在SDK服务器上工作正常,但在生产中失败。我在做什么甚至正确吗?如果是,那可能是什么问题,有什么办法解决它吗?

# Code earlier writes the file bs_file_name. This works fine because I can see the file
# in the Cloud Console.
bk = blobstore.create_gs_key( "/gs" + bs_file_name)
assert(bk)
if not isinstance(bk,blobstore.BlobKey):
    bk = blobstore.BlobKey(bk)
assert isinstance(bk,blobstore.BlobKey)
# next line fails here in production only
assert(blobstore.get(bk))  # <----------- blobstore.get(bk) returns None 
Run Code Online (Sandbox Code Playgroud)

python google-app-engine blobstore google-cloud-storage

4
推荐指数
1
解决办法
2580
查看次数