python - Can't find the cause "TypeError: coercing to Unicode: need string or buffer, NoneType found" -



python - Can't find the cause "TypeError: coercing to Unicode: need string or buffer, NoneType found" -

i'm getting error production server:

file "/home/example/svn/libs/django/core/handlers/base.py", line 100, in get_response response = callback(request, *callback_args, **callback_kwargs) file "/home/example/svn/src/app/../app/libs/auth/decorators.py", line 125, in __call__ homecoming self.view_func(request, *args, **kwargs) file "/home/example/svn/src/app/../app/membership/decorators.py", line 64, in __call__ homecoming self.view_func(request, *args, **kwargs) file "/home/example/svn/src/app/../app/site/views/system/invoices.py", line 168, in send_via_email_form homecoming sendviaemailformpage(request, pk, what, sending_type).custom() file "/home/example/svn/src/app/../app/security/security.py", line 99, in execute homecoming func(*args, **kw) file "/home/example/svn/src/app/../app/site/views/system/invoices.py", line 405, in custom homecoming self.custom_response or self.response() file "/home/example/svn/src/app/../app/security/security.py", line 99, in execute homecoming func(*args, **kw) file "/home/example/svn/src/app/../app/libs/pages/__init__.py", line 235, in response response = render_to_response(self.template, self.data, context_instance=requestcontext(self.request, self.data)) file "/home/example/svn/libs/django/shortcuts/__init__.py", line 20, in render_to_response homecoming httpresponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs) file "/home/example/svn/libs/django/template/loader.py", line 186, in render_to_string homecoming t.render(context_instance) file "/home/example/svn/libs/django/template/__init__.py", line 173, in render homecoming self._render(context) file "/home/example/svn/libs/django/template/__init__.py", line 167, in _render homecoming self.nodelist.render(context) file "/home/example/svn/libs/django/template/__init__.py", line 796, in render bits.append(self.render_node(node, context)) file "/home/example/svn/libs/django/template/__init__.py", line 809, in render_node homecoming node.render(context) file "/home/example/svn/libs/django/template/__init__.py", line 849, in render homecoming _render_value_in_context(output, context) file "/home/example/svn/libs/django/template/__init__.py", line 829, in _render_value_in_context value = force_unicode(value) file "/home/example/svn/libs/django/utils/encoding.py", line 66, in force_unicode s = unicode(s) typeerror: coercing unicode: need string or buffer, nonetype found

unfortunely can't reproduce in way on development server. exception not helping much. django code:

if hasattr(s, '__unicode__'): s = unicode(s)

if has 'unicode' attribute, why nonetype found. have dig python source code 1 ? appreciate help.

thanks.

focus on portion of traceback. looks code wrote.

file "/home/example/svn/src/app/../app/membership/decorators.py", line 64, in __call__ homecoming self.view_func(request, *args, **kwargs) file "/home/example/svn/src/app/../app/site/views/system/invoices.py", line 168, in send_via_email_form homecoming sendviaemailformpage(request, pk, what, sending_type).custom() file "/home/example/svn/src/app/../app/security/security.py", line 99, in execute homecoming func(*args, **kw) file "/home/example/svn/src/app/../app/site/views/system/invoices.py", line 405, in custom homecoming self.custom_response or self.response() file "/home/example/svn/src/app/../app/security/security.py", line 99, in execute homecoming func(*args, **kw) file "/home/example/svn/src/app/../app/libs/pages/__init__.py", line 235, in response response = render_to_response(self.template, self.data, context_instance=requestcontext(self.request, self.data))

somewhere there's none there should have been string.

in many cases, arises because have unauthenticated user default anonymous user lacks various attribute values "real" users have. doesn't have problems in development because have cookies on development pc allow login. may missing cookie production server, , aren't getting logged in.

it helps add together lots , lots of logging output view function involved in can read through apache logs , see things breaking.

python django

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -