[Devel] [Kaboom at OH] Error (EXTERNAL IP): /search/
Raphael Krut-Landau
raphael at openhatch.org
Sat May 15 15:34:52 UTC 2010
Fixed, but poorly. I just stripped null bytes from the parameter in
the function "make_text_safe" (in search/templatetags/search.py). The
problem is that the literal string "\0" appears in the description,
and we're clearly not encoding that correctly. So it's not showing up
properly, and now I've stripped it out entirely.
On Sat, May 15, 2010 at 11:30 AM, <mr_website at linode.openhatch.org> wrote:
> Traceback (most recent call last):
>
> File "/home/deploy/milestone-a.buildout/parts/production/django/core/handlers/base.py", line 99, in get_response
> response = callback(request, *callback_args, **callback_kwargs)
>
> File "/home/deploy/milestone-a.buildout/mysite/search/views.py", line 154, in fetch_bugs
> return render_response(request, 'search/search.html', data)
>
> File "/home/deploy/milestone-a.buildout/mysite/base/helpers.py", line 44, in render_response
> return django.shortcuts.render_to_response(*args, **kwargs)
>
> File "/home/deploy/milestone-a.buildout/parts/production/django/shortcuts/__init__.py", line 20, in render_to_response
> return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
>
> File "/home/deploy/milestone-a.buildout/parts/production/django/template/loader.py", line 108, in render_to_string
> return t.render(context_instance)
>
> File "/home/deploy/milestone-a.buildout/parts/production/django/template/__init__.py", line 178, in render
> return self.nodelist.render(context)
>
> File "/home/deploy/milestone-a.buildout/parts/production/django/template/__init__.py", line 779, in render
> bits.append(self.render_node(node, context))
>
> File "/home/deploy/milestone-a.buildout/parts/production/django/template/__init__.py", line 792, in render_node
> return node.render(context)
>
> File "/home/deploy/milestone-a.buildout/parts/production/django/template/loader_tags.py", line 97, in render
> return compiled_parent.render(context)
>
> File "/home/deploy/milestone-a.buildout/parts/production/django/template/__init__.py", line 178, in render
> return self.nodelist.render(context)
>
> File "/home/deploy/milestone-a.buildout/parts/production/django/template/__init__.py", line 779, in render
> bits.append(self.render_node(node, context))
>
> File "/home/deploy/milestone-a.buildout/parts/production/django/template/__init__.py", line 792, in render_node
> return node.render(context)
>
> File "/home/deploy/milestone-a.buildout/parts/production/django/template/loader_tags.py", line 24, in render
> result = self.nodelist.render(context)
>
> File "/home/deploy/milestone-a.buildout/parts/production/django/template/__init__.py", line 779, in render
> bits.append(self.render_node(node, context))
>
> File "/home/deploy/milestone-a.buildout/parts/production/django/template/__init__.py", line 792, in render_node
> return node.render(context)
>
> File "/home/deploy/milestone-a.buildout/parts/production/django/template/defaulttags.py", line 248, in render
> return self.nodelist_true.render(context)
>
> File "/home/deploy/milestone-a.buildout/parts/production/django/template/__init__.py", line 779, in render
> bits.append(self.render_node(node, context))
>
> File "/home/deploy/milestone-a.buildout/parts/production/django/template/__init__.py", line 792, in render_node
> return node.render(context)
>
> File "/home/deploy/milestone-a.buildout/parts/production/django/template/defaulttags.py", line 160, in render
> nodelist.append(node.render(context))
>
> File "/home/deploy/milestone-a.buildout/parts/production/django/template/loader_tags.py", line 111, in render
> return self.template.render(context)
>
> File "/home/deploy/milestone-a.buildout/parts/production/django/template/__init__.py", line 178, in render
> return self.nodelist.render(context)
>
> File "/home/deploy/milestone-a.buildout/parts/production/django/template/__init__.py", line 779, in render
> bits.append(self.render_node(node, context))
>
> File "/home/deploy/milestone-a.buildout/parts/production/django/template/__init__.py", line 792, in render_node
> return node.render(context)
>
> File "/home/deploy/milestone-a.buildout/parts/production/django/template/__init__.py", line 826, in render
> output = self.filter_expression.resolve(context)
>
> File "/home/deploy/milestone-a.buildout/parts/production/django/template/__init__.py", line 572, in resolve
> new_obj = func(obj, *arg_vals)
>
> File "/home/deploy/milestone-a.buildout/mysite/search/templatetags/search.py", line 232, in highlight_filter
> return highlight(value, arg)['highlighted']
>
> File "/home/deploy/milestone-a.buildout/mysite/search/templatetags/search.py", line 194, in highlight
> safe_text = make_text_safe(text)
>
> File "/home/deploy/milestone-a.buildout/mysite/search/templatetags/search.py", line 164, in make_text_safe
> span_tag = lxml.html.builder.SPAN(s)
>
> File "/usr/lib/python2.5/site-packages/lxml/builder.py", line 222, in __call__
> v = t(elem, item)
>
> File "/usr/lib/python2.5/site-packages/lxml/builder.py", line 185, in add_text
> elem.text = (elem.text or "") + item
>
> File "lxml.etree.pyx", line 826, in lxml.etree._Element.text.__set__ (src/lxml/lxml.etree.c:9564)
>
> File "apihelpers.pxi", line 581, in lxml.etree._setNodeText (src/lxml/lxml.etree.c:30511)
>
> File "apihelpers.pxi", line 1141, in lxml.etree._utf8 (src/lxml/lxml.etree.c:34647)
>
> ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL bytes
>
>
> <WSGIRequest
> GET:<QueryDict: {u'language': [u'Python']}>,
> POST:<QueryDict: {}>,
> COOKIES:{'__utma': '15746536.1870235466.1268150447.1273885368.1273935971.72',
> '__utma_a2a': '5938776429.1299016259.1267459333.1273512457.1273512823.166',
> '__utmb': '15746536.2.10.1273935971',
> '__utmc': '15746536',
> '__utmz': '15746536.1271958911.59.12.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=slashdot%20openhatch',
> 'openid_provider': 'google',
> 'sessionid': '50249d1c87ecbc125a00c2de0f7fbbf8'},
> META:{'DOCUMENT_ROOT': '/var/www/',
> 'GATEWAY_INTERFACE': 'CGI/1.1',
> 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
> 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
> 'HTTP_ACCEPT_ENCODING': 'gzip,deflate',
> 'HTTP_ACCEPT_LANGUAGE': 'en-us,en;q=0.5',
> 'HTTP_CACHE_CONTROL': 'no-cache',
> 'HTTP_CONNECTION': 'close',
> 'HTTP_COOKIE': 'openid_provider=google; sessionid=50249d1c87ecbc125a00c2de0f7fbbf8; __utma_a2a=5938776429.1299016259.1267459333.1273512457.1273512823.166; __utma=15746536.1870235466.1268150447.1273885368.1273935971.72; __utmz=15746536.1271958911.59.12.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=slashdot%20openhatch; __utmb=15746536.2.10.1273935971; __utmc=15746536',
> 'HTTP_HOST': 'openhatch.org',
> 'HTTP_PRAGMA': 'no-cache',
> 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3',
> 'HTTP_X_FORWARDED_FOR': '98.140.110.121',
> 'HTTP_X_REAL_IP': '98.140.110.121',
> 'PATH': '/usr/local/bin:/usr/bin:/bin',
> 'PATH_INFO': u'/search/',
> 'PATH_TRANSLATED': '/home/deploy/milestone-a.buildout/bin/production.wsgi/search/',
> 'QUERY_STRING': 'language=Python',
> 'REMOTE_ADDR': '98.140.110.121',
> 'REMOTE_PORT': '36455',
> 'REQUEST_METHOD': 'GET',
> 'REQUEST_URI': '/search/?language=Python',
> 'SCRIPT_FILENAME': '/home/deploy/milestone-a.buildout/bin/production.wsgi',
> 'SCRIPT_NAME': u'',
> 'SCRIPT_URI': 'http://openhatch.org/search/',
> 'SCRIPT_URL': '/search/',
> 'SERVER_ADDR': '127.0.0.1',
> 'SERVER_ADMIN': 'webmaster at localhost',
> 'SERVER_NAME': 'openhatch.org',
> 'SERVER_PORT': '80',
> 'SERVER_PROTOCOL': 'HTTP/1.0',
> 'SERVER_SIGNATURE': '<address>Apache/2.2.14 (Debian) Server at openhatch.org Port 80</address>\n',
> 'SERVER_SOFTWARE': 'Apache/2.2.14 (Debian)',
> 'mod_wsgi.application_group': 'openhatch.org|',
> 'mod_wsgi.callable_object': 'application',
> 'mod_wsgi.listener_host': '127.0.0.1',
> 'mod_wsgi.listener_port': '80',
> 'mod_wsgi.process_group': 'http',
> 'mod_wsgi.reload_mechanism': '1',
> 'mod_wsgi.script_reloading': '1',
> 'mod_wsgi.version': (2, 5),
> 'wsgi.errors': <mod_wsgi.Log object at 0x88c9290>,
> 'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter object at 0x8579650>,
> 'wsgi.input': <mod_wsgi.Input object at 0x88d1610>,
> 'wsgi.multiprocess': True,
> 'wsgi.multithread': False,
> 'wsgi.run_once': False,
> 'wsgi.url_scheme': 'http',
> 'wsgi.version': (1, 0)}>
>
More information about the Devel
mailing list