Q:

Google App Engine Launcher throws ascii codec error when deploying image file

I have these errors showing up on deployment through app engine launcher, and they only show up when I have any image files in a static dir (I tried a couple of small .jpg and .png images used by template). Therefore, I cannot upload any static image files to host.
It is PHP app.
Deployment window shows
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.

I've been troubled by this for a while now, and haven't found any useful answers, any ideas?
Edit:
Solution
Thanks, finally I got it, in app.yaml I was using pieces from tutorial which bundled all images like this
- url: /(.*\.(bmp|gif|ico|jpeg|jpg|png))
  static_files: template/\1
  upload: template/(.*\.(bmp|gif|ico|jpeg|jpg|png))

But for some reason this is the way to go
- url: /(.*\.png)
  mime_type: image/png
  static_files: template/\1
  upload: template/(.*\.png)

Without declaring mime_type it won't work.

A:

Thanks, finally I got it, in app.yaml I was using pieces from tutorial which bundled all images like this
- url: /(.*\.(bmp|gif|ico|jpeg|jpg|png))
  static_files: template/\1
  upload: template/(.*\.(bmp|gif|ico|jpeg|jpg|png))

But for some reason this is the way to go
- url: /(.*\.png)
  mime_type: image/png
  static_files: template/\1
  upload: template/(.*\.png)

Without declaring mime_type it won't work.

