使用 appcfg.py 下载 App Engine 源代码时出错

Error downloading App Engine source code with appcfg.py

我尝试使用以下方法从 google 下载我的代码:

appcfg.py download_app -A "canada-math"  ./trunk3

我在主目录下安装了旧的应用程序引擎,您可以在下面的错误输出中看到它。

appcfg.py download_app -A "canada-math"  ./trunk3

我明白了:

stephen@stephen-AO725:~/webprog$ appcfg.py download_app -A "canada-math"  ./trunk3

05:06 PM Host: appengine.google.com
05:06 PM Fetching file list...
Traceback (most recent call last):
  File "/home/stephen/webprog/google_appengine/appcfg.py", line 171, in <module>
    run_file(__file__, globals())
  File "/home/stephen/webprog/google_appengine/appcfg.py", line 167, in run_file
    execfile(script_path, globals_)
  File "/home/stephen/webprog/google_appengine/google/appengine/tools/appcfg.py", line 4282, in <module>
    main(sys.argv)
  File "/home/stephen/webprog/google_appengine/google/appengine/tools/appcfg.py", line 4273, in main
    result = AppCfgApp(argv).Run()
  File "/home/stephen/webprog/google_appengine/google/appengine/tools/appcfg.py", line 2409, in Run
    self.action(self)
  File "/home/stephen/webprog/google_appengine/google/appengine/tools/appcfg.py", line 4003, in __call__
    return method()
  File "/home/stephen/webprog/google_appengine/google/appengine/tools/appcfg.py", line 2861, in DownloadApp
    DoDownloadApp(rpcserver, out_dir, app_id, module, app_version)
  File "/home/stephen/webprog/google_appengine/google/appengine/tools/appcfg.py", line 1373, in DoDownloadApp
    result = rpcserver.Send('/api/files/list', **url_args)
  File "/home/stephen/webprog/google_appengine/google/appengine/tools/appengine_rpc.py", line 393, in Send
    f = self.opener.open(req)
  File "/usr/lib/python2.7/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 447, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1241, in https_open
    context=self._context)
TypeError: do_open() got an unexpected keyword argument 'context'

最简单的修复可能是通过 Cloud Shell 运行 appcfg.py 下载源代码。这将确保您的 appcfg.py 和 Python 版本与 App Engine API.

兼容

根据您的 appcfg 和 Python 的特定版本,您的版本可能不匹配。还要记住 appcfg is deprecated。另见: