首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >gcs客户端库停止使用dev_appserver

gcs客户端库停止使用dev_appserver
EN

Stack Overflow用户
提问于 2019-07-18 18:31:25
回答 1查看 40关注 0票数 1

当我试图通过开发服务器上传时,Google云存储客户端库将返回500错误。

代码语言:javascript
复制
ServerError: Expect status [200] from Google Storage. But got status 500.

我没有对项目进行任何更改,而且代码在生产中仍然正常工作。

我尝试gcloud components update获得最新的dev_server,并更新到最新的Google云存储客户端库。

我再次运行gcloud init,以确保已加载凭据,并确保使用了正确的桶。

该项目正在windows 10. Python版本2.7上运行。

知道为什么会这样吗?

谢谢

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-07-18 19:01:17

原来这是个问题已经有一段时间了。这与with存储文件名的生成方式有关。https://issuetracker.google.com/issues/35900575

修复方法是对这个文件进行猴子加密: google-cloud-sdk\platform\google_appengine\google\appengine\api\blobstore\file_blob_storage.py

代码语言:javascript
复制
def _FileForBlob(self, blob_key):
  """Calculate full filename to store blob contents in.

  This method does not check to see if the file actually exists.

  Args:
    blob_key: Blob key of blob to calculate file for.

  Returns:
    Complete path for file used for storing blob.
  """
  blob_key = self._BlobKey(blob_key)
  # Remove bad characters.
  import re
  blob_fname = re.sub(r"[^\w\./\\]", "_", str(blob_key))
  # Make sure it's a relative directory.
  if blob_fname and blob_fname[0] in "/\\":
    blob_fname = blob_fname[1:]
  return os.path.join(self._DirectoryForBlob(blob_key), blob_fname)
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57100699

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档