部署映像文件时,Google App Engine Launcher会抛出ascii编解码器错误

时间:2014-06-10 21:15:28

标签: php google-app-engine

我通过应用引擎启动器显示部署时出现这些错误,只有当我在静态目录中有任何图像文件时才显示这些错误(我尝试了模板使用的几个小.jpg和.png图像)。因此,我无法将任何静态图像文件上传到主机。

这是PHP应用程序。

部署窗口显示

11:01 PM Cloning 5 static files.
11:01 PM Cloning 112 application files.
11:01 PM Uploading 2 files and blobs.
2014-06-10 23:01:56,815 ERROR appcfg.py:2488 An unexpected error occurred. Aborting. 
Traceback (most recent call last):
  File "H:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2329, in DoUpload
self._UploadMissingFiles(missing_files, openfunc)
  File "H:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2467, in _UploadMissingFiles
self.blob_batcher.Flush()
  File "H:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 1402, in Flush
self.SendBatch()
  File "H:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 1361, in SendBatch
payload,
UnicodeDecodeError: 'ascii' codec can't decode byte 0x89 in position 0: ordinal not in range(128)
11:01 PM Rolling back the update.
Traceback (most recent call last):
  File "H:\Program Files (x86)\Google\google_appengine\appcfg.py", line 126, in <module>
    run_file(__file__, globals())
  File "H:\Program Files (x86)\Google\google_appengine\appcfg.py", line 122, in run_file
    execfile(_PATHS.script_file(script_name), globals_)
  File "H:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 5220, in <module>
main(sys.argv)
  File "H:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 5211, in main
result = AppCfgApp(argv).Run()
  File "H:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2886, in Run
self.action(self)
  File "H:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 4890, in __call__
return method()
  File "H:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3682, in Update
self._UpdateWithParsedAppYaml(appyaml, self.basepath)
  File "H:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3735, in _UpdateWithParsedAppYaml
self.UpdateVersion(rpcserver, basepath, appyaml, APP_YAML_FILENAME)
  File "H:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3618, in UpdateVersion
return appversion.DoUpload(paths, openfunc)
  File "H:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2329, in DoUpload
self._UploadMissingFiles(missing_files, openfunc)
  File "H:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2467, in _UploadMissingFiles
self.blob_batcher.Flush()
  File "H:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 1402, in Flush
self.SendBatch()
  File "H:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 1361, in SendBatch
payload,
UnicodeDecodeError: 'ascii' codec can't decode byte 0x89 in position 0: ordinal not in range(128)
2014-06-10 23:01:57 (Process exited with code 1)

You can close this window now.

我已经被这一段时间困扰了一段时间,并没有找到任何有用的答案,任何想法?

编辑:

解决方案

谢谢,最后我得到了它,在app.yaml我使用的教程中的片段捆绑了所有这样的图像

- url: /(.*\.(bmp|gif|ico|jpeg|jpg|png))
  static_files: template/\1
  upload: template/(.*\.(bmp|gif|ico|jpeg|jpg|png))

但由于某种原因,这是要走的路

- url: /(.*\.png)
  mime_type: image/png
  static_files: template/\1
  upload: template/(.*\.png)

如果没有声明mime_type,它就无法工作。

1 个答案:

答案 0 :(得分:3)

谢谢,最后我得到了它,在app.yaml我使用的教程中的片段捆绑了所有这样的图像

- url: /(.*\.(bmp|gif|ico|jpeg|jpg|png))
  static_files: template/\1
  upload: template/(.*\.(bmp|gif|ico|jpeg|jpg|png))

但由于某种原因,这是要走的路

- url: /(.*\.png)
  mime_type: image/png
  static_files: template/\1
  upload: template/(.*\.png)

如果没有声明mime_type,它就无法工作。