﻿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
8758	get_tag_uri in /django/utils/feedgenerator.py breaks with port numbers	nslater	Arthur Koziel	"The following function:

{{{

def get_tag_uri(url, date):
    ""Creates a TagURI. See http://diveintomark.org/archives/2004/05/28/howto-atom-id""
    tag = re.sub('^http://', '', url)
    if date is not None:
        tag = re.sub('/', ',%s:/' % date.strftime('%Y-%m-%d'), tag, 1)
    tag = re.sub('#', '/', tag)
    return u'tag:' + tag
}}

- http://code.djangoproject.com/browser/django/trunk/django/utils/feedgenerator.py#L48

... breaks for domain names with a port number, such as http://example.org:8080/ as this produces the following TAG value:

{{{
tag:example.org:8080,2007-09-21:/
}}}

From http://feedvalidator.org/docs/error/InvalidTAG.html and http://tools.ietf.org/html/rfc4151#section-2.1 you can see that the TAG URI should not contain the port number.

The following patch should be able to extract the domain name from the link:

{{{
-    tag = re.sub('^http://', '', url)
+    tag = str(urllib.splitport(urllib.splithost(urllib.splittype(url)[1])[0])[0])
}}}"		closed	contrib.syndication	1.0		fixed			Accepted	1	0	0	0	0	0
