PHP + GAE上的UnicodeDecodeError

时间:2014-07-02 06:54:45

标签: php google-app-engine python-2.7

我失去了有关这方面的任何资源,任何人都可以帮助我。

基本上我有系统目前通过谷歌应用引擎上传到云端,我使用PHP,直到现在我还没有遇到上传这样的错误,经过几天修复我的网站上的一些问题我想上传更改然后它引导我犯这个错误

02:46 PM Uploading 36 files and blobs.
2014-07-02 14:46:19,551 ERROR appcfg.py:2488 An unexpected error occurred. Aborting. 
Traceback (most recent call last):
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2329, in DoUpload
    self._UploadMissingFiles(missing_files, openfunc)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2455, in _UploadMissingFiles
    self.UploadFile(missing_file, file_handle)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2002, in UploadFile
    file_classification.StaticMimeType())
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 1442, in AddToBatch
    self.SendSingleFile(path, payload, mime_type)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 1388, in SendSingleFile
    path=path)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 1684, in Send
    result = self.rpcserver.Send(url, payload=payload, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 408, in Send
    HttpRequestToString(req, include_data=self.debug_data))
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 102, in HttpRequestToString
    'data': req.get_data(),
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 307343: ordinal not in range(128)
02:46 PM Rolling back the update.
Traceback (most recent call last):
  File "C:\Program Files (x86)\Google\google_appengine\appcfg.py", line 126, in <module>
    run_file(__file__, globals())
  File "C:\Program Files (x86)\Google\google_appengine\appcfg.py", line 122, in run_file
    execfile(_PATHS.script_file(script_name), globals_)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 5220, in <module>
    main(sys.argv)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 5211, in main
    result = AppCfgApp(argv).Run()
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2886, in Run
    self.action(self)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 4890, in __call__
    return method()
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3682, in Update
    self._UpdateWithParsedAppYaml(appyaml, self.basepath)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3735, in _UpdateWithParsedAppYaml
    self.UpdateVersion(rpcserver, basepath, appyaml, APP_YAML_FILENAME)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3618, in UpdateVersion
    return appversion.DoUpload(paths, openfunc)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2329, in DoUpload
    self._UploadMissingFiles(missing_files, openfunc)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2455, in _UploadMissingFiles
    self.UploadFile(missing_file, file_handle)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2002, in UploadFile
    file_classification.StaticMimeType())
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 1442, in AddToBatch
    self.SendSingleFile(path, payload, mime_type)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 1388, in SendSingleFile
    path=path)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 1684, in Send
    result = self.rpcserver.Send(url, payload=payload, **kwargs)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 408, in Send
    HttpRequestToString(req, include_data=self.debug_data))
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 102, in HttpRequestToString
    'data': req.get_data(),
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 307343: ordinal not in range(128)
2014-07-02 14:46:21 (Process exited with code 1)

You can close this window now.

这是我的app.yaml

url: /assets/lib/parsley/(.*\.md)
  static_files: assets/lib/parsley/\1
  upload: assets/lib/parsley/(.*\.md)
  mime_type: text/x-markdown

- url: /assets/lib/nvd3/(.*\.md)
  static_files: assets/lib/nvd3/\1
  upload: assets/lib/nvd3/(.*\.md)
  mime_type: text/x-markdown

- url: /assets/js/(.*\.json)
  static_files: assets/js/\1
  upload: assets/js/(.*\.json)
  mime_type: application/json

- url: /assets/lib/examples/(.*\.json)
  static_files: assets/lib/examples/\1
  upload: assets/lib/examples/(.*\.json)
  mime_type: application/json

- url: /assets/css/fonts/glyphicons/(.*\.(eot|ttf|woff))
  static_files: assets/css/fonts/glyphicons/\1
  upload: assets/css/fonts/glyphicons/(.*\.(eot|ttf|woff))
  mime_type: application/x-woff

- url: /assets/css/fonts/font-awesome/(.*\.(eot|ttf|woff|otf))
  static_files: assets/css/fonts/font-awesome/\1
  upload: assets/css/fonts/font-awesome/(.*\.(eot|ttf|woff|otf))
  mime_type: application/font-woff 

- url: /assets/css/fontello/font/(.*\.(eot|ttf|woff))
  static_files: assets/css/fontello/font/\1
  upload: assets/css/fontello/font/(.*\.(eot|ttf|woff))
  mime_type: application/x-woff

- url: /assets/css/font/(.*\.(eot|ttf|woff))
  static_files: assets/css/font/\1
  upload: assets/css/font/(.*\.(eot|ttf|woff))
  mime_type: application/x-woff

- url: /assets/css
  static_dir: assets/css

- url: /assets/js
  static_dir: assets/js

- url: /assets/lib
  static_dir: assets/lib

- url: /assets/img
  static_dir: assets/img

- url: /.*
  script: index.php
  secure: always

我不知道任何与python有关的东西,我只使用过PHP,javascript和Google应用引擎。

任何人都可以帮助我UnicodeDecodeError的原因。 我还能做些什么来解决这个问题?

任何建议和信息都将是一个很大的帮助。提前致谢。

1 个答案:

答案 0 :(得分:1)

我的猜测是你的应用程序中有一个文件,其名称中包含unicode字符,这会阻止你的应用上传。

修复方法是重命名文件以使用ascii字符。