UnicodeDecodeError:'ascii'编解码器无法解码位置0的字节0xef:序号不在范围内(128)

时间:2014-06-22 05:57:59

标签: google-app-engine

我的主题有.js文件,它曾经用过。但是今天当我注释掉一些代码行,或者只是打开并保存它并更新我的应用程序时,我收到了这个错误

UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 0: ordinal not in range(128)

完整错误是

2014-06-22 14:52:01,388 ERROR appcfg.py:2487 An unexpected error occurred. Aborting. 
Traceback (most recent call last):
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 2328, in DoUpload
    self._UploadMissingFiles(missing_files, openfunc)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 2466, in _UploadMissingFiles
    self.blob_batcher.Flush()
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 1401, in Flush
    self.SendBatch()
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 1360, in SendBatch
    payload,
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 0: ordinal not in range(128)
02:52 PM Rolling back the update.
Traceback (most recent call last):
  File "C:\Program Files\Google\google_appengine\appcfg.py", line 126, in <module>
    run_file(__file__, globals())
  File "C:\Program Files\Google\google_appengine\appcfg.py", line 122, in run_file
    execfile(_PATHS.script_file(script_name), globals_)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 5214, in <module>
    main(sys.argv)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 5205, in main
    result = AppCfgApp(argv).Run()
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 2885, in Run
    self.action(self)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 4884, in __call__
    return method()
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 3681, in Update
    self._UpdateWithParsedAppYaml(appyaml, self.basepath)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 3734, in _UpdateWithParsedAppYaml
    self.UpdateVersion(rpcserver, basepath, appyaml, APP_YAML_FILENAME)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 3617, in UpdateVersion
    return appversion.DoUpload(paths, openfunc)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 2328, in DoUpload
    self._UploadMissingFiles(missing_files, openfunc)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 2466, in _UploadMissingFiles
    self.blob_batcher.Flush()
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 1401, in Flush
    self.SendBatch()
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 1360, in SendBatch
    payload,
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 0: ordinal not in range(128)
2014-06-22 14:52:03 (Process exited with code 1)

You can close this window now.

我的档案是https://dl.dropboxusercontent.com/u/27576887/StackOverFlow/charisma.js 我在VS 2012中打开并编辑该文件 请告诉我这里有什么问题? 谢谢!

2 个答案:

答案 0 :(得分:1)

显然,这是一个编码问题:您的代码中有一个或多个字符在上传时无法解码。 Check sendBatch method at 1282

如果你能没有有问题的角色那么你就可以去了。 Otherwise, it seems that updating your server directly through appcfg.py in terminal makes it.

python appcfg.py update

无论哪种方式,追踪这个问题的进展都很有意思。

答案 1 :(得分:0)

文件保存为Unicode UTF-8,无需签名。 我把它换成了日本的SHIft-JIS,它又恢复了工作。