上传Google App Engine应用程序时出错

时间:2014-02-13 05:15:47

标签: 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'

4 个答案:

答案 0 :(得分:5)

这是一个正则表达式错误,在上传时:你不能使用\ 1或\ 2

以下是修正:https://github.com/coto/gae-boilerplate/commit/7fbcba2cb217f8ccd8ced7bfe634b4aceaf616c6

答案 1 :(得分:0)

而不是“dev”作为版本号,请尝试输入实际数字:)

答案 2 :(得分:0)

dev是保留关键字。更改版本,而不是使用数字或小写字符串。

它为我工作

答案 3 :(得分:0)

通过在此处打印,很容易弄清楚app.yaml的哪个文件存在问题。

/home/nburn42/Apps/google_appengine/google/appengine/tools/appcfg.py

第315行

这可能有点矫枉过正,但肯定会让你失意。