﻿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
29667	path converters don't handle spaces well.	Keryn Knight	Hasan Ramezani	"This came up for someone on IRC last week, but I can't see that they raised a ticket about it.

Correct:
{{{
>>> from django.urls.resolvers import _route_to_regex
>>> _route_to_regex(""<uuid:test>"")
('^(?P<test>[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})',
 {'test': <django.urls.converters.UUIDConverter at 0x1055e8c88>})
}}}

Also working correctly:
{{{
>>> from django.urls.resolvers import _route_to_regex
>>> _route_to_regex(""<uuid:2>"")
ImproperlyConfigured: URL route '<uuid:2>' uses parameter name '2' which isn't a valid Python identifier.
}}}

however, constructing a valid **looking** converter reference apparently hits neither the happy nor the unhappy path, and also I presume passes any system checks in place that might otherwise warn about the sensitivity:
{{{
>>> from django.urls.resolvers import _route_to_regex
>>> _route_to_regex(""<uuid: test>"")  # note the preceeding space
('^\\<uuid\\:\\ test\\>', {})
}}}
- the regex is invalid
- the kwargs dictionary is (sort of rightly) empty.
- the same is true with ""test "" and ""te st""

Unless I'm misunderstanding the code therein, ""test "", "" test"" and ""te st"" should all be hitting the invalid identifier part, and personally I feel like leading/trailing spaces at least could just be sanitised (stripped) as they're almost certainly accidental or for display purposes.

Tested in a shell against master @ 7eb556a6c2b2ac9313158f8b812eebea02a43f20."	Bug	closed	Core (URLs)	dev	Normal	fixed	converters path _route_to_regex	Tom Forbes Vishvajit Pathak	Ready for checkin	1	0	0	0	0	0
