1. Marcin Kuzminski
  2. RhodeCode
  3. Issues

Issues

Issue #674 resolved

Setting alternative gravatar url produces errors sometimes

Aaron Graddy
created an issue

I tried setting alternative_gravatar_url to pull avatars from somewhere else, but in some cases it produces an error. On the home page, admin, and most other places it works fine. When I click on a repo, then changelog it will throw:

Error - <type 'exceptions.TypeError'>: expected a character buffer object
URL: http://##myurl##:5000/core-svn/changelog
File '/usr/local/lib/python2.6/dist-packages/WebError-0.10.3-py2.6.egg/weberror/errormiddleware.py', line 162 in __call__
  app_iter = self.application(environ, sr_checker)
File '/usr/local/lib/python2.6/dist-packages/Beaker-1.6.4-py2.6.egg/beaker/middleware.py', line 155 in __call__
  return self.wrap_app(environ, session_start_response)
File '/usr/local/lib/python2.6/dist-packages/Routes-1.13-py2.6.egg/routes/middleware.py', line 131 in __call__
  response = self.app(environ, start_response)
File '/usr/local/lib/python2.6/dist-packages/Pylons-1.0-py2.6.egg/pylons/wsgiapp.py', line 107 in __call__
  response = self.dispatch(controller, environ, start_response)
File '/usr/local/lib/python2.6/dist-packages/Pylons-1.0-py2.6.egg/pylons/wsgiapp.py', line 312 in dispatch
  return controller(environ, start_response)
File '/usr/local/lib/python2.6/dist-packages/RhodeCode-1.4.4-py2.6.egg/rhodecode/lib/base.py', line 267 in __call__
  return WSGIController.__call__(self, environ, start_response)
File '/usr/local/lib/python2.6/dist-packages/Pylons-1.0-py2.6.egg/pylons/controllers/core.py', line 211 in __call__
  response = self._dispatch_call()
File '/usr/local/lib/python2.6/dist-packages/Pylons-1.0-py2.6.egg/pylons/controllers/core.py', line 162 in _dispatch_call
  response = self._inspect_call(func)
File '/usr/local/lib/python2.6/dist-packages/Pylons-1.0-py2.6.egg/pylons/controllers/core.py', line 105 in _inspect_call
  result = self._perform_call(func, args)
File '/usr/local/lib/python2.6/dist-packages/Pylons-1.0-py2.6.egg/pylons/controllers/core.py', line 57 in _perform_call
  return func(**args)
File '/usr/local/lib/python2.6/dist-packages/RhodeCode-1.4.4-py2.6.egg/rhodecode/controllers/changelog.py', line 98 in index
  return render('changelog/changelog.html')
File '/usr/local/lib/python2.6/dist-packages/Pylons-1.0-py2.6.egg/pylons/templating.py', line 243 in render_mako
  cache_type=cache_type, cache_expire=cache_expire)
File '/usr/local/lib/python2.6/dist-packages/Pylons-1.0-py2.6.egg/pylons/templating.py', line 218 in cached_template
  return render_func()
File '/usr/local/lib/python2.6/dist-packages/Pylons-1.0-py2.6.egg/pylons/templating.py', line 240 in render_template
  return literal(template.render_unicode(**globs))
File '/usr/local/lib/python2.6/dist-packages/Mako-0.7.2-py2.6.egg/mako/template.py', line 421 in render_unicode
  as_unicode=True)
File '/usr/local/lib/python2.6/dist-packages/Mako-0.7.2-py2.6.egg/mako/runtime.py', line 766 in _render
  **_kwargs_for_callable(callable_, data))
File '/usr/local/lib/python2.6/dist-packages/Mako-0.7.2-py2.6.egg/mako/runtime.py', line 798 in _render_context
  _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File '/usr/local/lib/python2.6/dist-packages/Mako-0.7.2-py2.6.egg/mako/runtime.py', line 819 in _exec_template
  _render_error(template, context, e)
File '/usr/local/lib/python2.6/dist-packages/Mako-0.7.2-py2.6.egg/mako/runtime.py', line 828 in _render_error
  result = template.error_handler(context, error)
File '/usr/local/lib/python2.6/dist-packages/Mako-0.7.2-py2.6.egg/mako/runtime.py', line 817 in _exec_template
  callable_(context, *args, **kwargs)
File '/home/agraddy/Development/rhodecode/data/templates/base/root.html.py', line 68 in render_body
  __M_writer(escape(next.body()))
File '/home/agraddy/Development/rhodecode/data/templates/base/base.html.py', line 73 in render_body
  __M_writer(escape(next.main()))
File '/home/agraddy/Development/rhodecode/data/templates/changelog/changelog.html.py', line 128 in render_main
  __M_writer(escape(h.gravatar_url(h.email_or_none(cs.author),16)))
File '/usr/local/lib/python2.6/dist-packages/RhodeCode-1.4.4-py2.6.egg/rhodecode/lib/helpers.py', line 720 in gravatar_url
  tmpl = tmpl.replace('{email}', email_address)\
TypeError: expected a character buffer object

It does it when I set it to a simple http server serving images, or even if I point it to the gravatar server that it uses out of the box:

alternative_gravatar_url = http://www.gravatar.com/avatar/{md5email}?s={size}

Thanks.

Comments (1)

  1. Log in to comment