google-app-engine - 上传 Google App Engine 应用程序时出错

标签 google-app-engine python-2.7 yaml app.yaml

我正在使用普通命令在 Google App Engine(Python 2.7、SDK 1.8.9)中上传我的应用程序:

appcfg.py --oauth2 update .

但是在我的项目中进行重构后,app.yaml ( here is the code) 的正则表达式中出现错误

错误是:

02:00 AM Application: sandengine; version: dev
02:00 AM Host: appengine.google.com
02:00 AM Starting update of app: sandengine, version: dev
02:00 AM Getting current resource limits.
02:00 AM Scanning files on local disk.
Traceback (most recent call last):
  File "/usr/local/bin/appcfg.py", line 199, in <module>
    run_file(__file__, globals())
  File "/usr/local/bin/appcfg.py", line 195, in run_file
    execfile(script_path, globals_)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 4933, in <module>
main(sys.argv)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 4924, in main
result = AppCfgApp(argv).Run()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2648, in Run
self.action(self)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 4604, in __call__
return method()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3419, in Update
self._UpdateWithParsedAppYaml(appyaml, self.basepath)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3466, in _UpdateWithParsedAppYaml
self.UpdateVersion(rpcserver, basepath, appyaml, APP_YAML_FILENAME)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3357, in UpdateVersion
return appversion.DoUpload(paths, openfunc)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2143, in DoUpload
self._AddFilesThatAreSmallEnough(paths, openfunc)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2211, in _AddFilesThatAreSmallEnough
file_classification = FileClassification(self.config, path)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 257, in __init__
self.__static_mime_type = self.__GetMimeTypeIfStaticFile(config, filename)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 287, in __GetMimeTypeIfStaticFile
if re.match(regex, filename):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 137, in match
return _compile(pattern, flags).match(string)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 242, in _compile
raise error, v # invalid expression
sre_constants.error: bogus escape: '\\1'

最佳答案

这是一个正则表达式错误,在upload: you can't use\1 or\2

这里是修复:https://github.com/coto/gae-boilerplate/commit/7fbcba2cb217f8ccd8ced7bfe634b4aceaf616c6

关于google-app-engine - 上传 Google App Engine 应用程序时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21745828/

相关文章:

python - 在python中禁用yaml文件的别名

java - 在 AppEngine 中解码国际字符

python - os.walk().next() 中类 'next' 的未解析属性引用 'Iterable'

java - 如何在 gwt 中获取电子邮件的内容?

Django 推荐引擎只能通过 python shell 工作

python - py2exe exe 启动后立即关闭

c# - 使用 C#,是否可以在不定义大量类型的情况下查询 YAML?

amazon-web-services - 如何使用aws中的cloudformation请求api网关中的参数并将其传递给lambda函数?

python - docker 内的GAE。不能暴露8080

python - 使用python将大文件下载到谷歌云存储