﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
19070	urlize template filter raises exception in some cases	rivolaks@…	Sasha Romijn	"In some cases, urlize template filter fails because it's trying to parse ipv6 url and exception is raised:

{{{
>>> from django.utils.html import urlize
>>> urlize('www.ee]')
Traceback (most recent call last):
  File ""<stdin>"", line 1, in <module>
  File ""django/utils/functional.py"", line 193, in wrapper
    return func(*args, **kwargs)
  File ""django/utils/html.py"", line 213, in urlize
    url = smart_urlquote('http://%s' % middle)
  File ""django/utils/html.py"", line 152, in smart_urlquote
    scheme, netloc, path, query, fragment = urlsplit(url)
  File ""/usr/lib/python2.7/urlparse.py"", line 183, in urlsplit
    raise ValueError(""Invalid IPv6 URL"")
ValueError: Invalid IPv6 URL
}}}

'www.google.com]' also breaks, but 'google.com]' doesn't.

IMHO urlize filter should never raise exceptions. In my case it is used on plaintext user input which we have no control over, and I'm assuming that errors in Django's template rendering are always handled internally and silently. In this case I'd expect urlize() to catch the ValueError from urlsplit and handle it somehow, e.g. by skipping the url.

Happens in both 1.4 as well as master, 1.3 is not affected."	Bug	closed	Template system	dev	Normal	fixed	dceu13	eromijn@…	Unreviewed	1	0	0	0	0	0
