Index: django/template/defaulttags.py
===================================================================
--- django/template/defaulttags.py	(revision 4556)
+++ django/template/defaulttags.py	(working copy)
@@ -925,6 +925,8 @@
         for arg in bits[2].split(','):
             if '=' in arg:
                 k, v = arg.split('=', 1)
+                if ' ' in k: 
+                    raise TemplateSyntaxError, "'%s' must not have spaces in keyword arguments" % bits[0]
                 kwargs[k] = parser.compile_filter(v)
             else:
                 args.append(parser.compile_filter(arg))
Index: tests/regressiontests/templates/views.py
===================================================================
--- tests/regressiontests/templates/views.py	(revision 4556)
+++ tests/regressiontests/templates/views.py	(working copy)
@@ -8,3 +8,6 @@
 
 def client_action(request, id, action):
     pass
+
+def client_location(request, country, city):
+    pass
Index: tests/regressiontests/templates/tests.py
===================================================================
--- tests/regressiontests/templates/tests.py	(revision 4556)
+++ tests/regressiontests/templates/tests.py	(working copy)
@@ -651,11 +651,13 @@
             'url01' : ('{% url regressiontests.templates.views.client client.id %}', {'client': {'id': 1}}, '/url_tag/client/1/'),
             'url02' : ('{% url regressiontests.templates.views.client_action client.id,action="update" %}', {'client': {'id': 1}}, '/url_tag/client/1/update/'),
             'url03' : ('{% url regressiontests.templates.views.index %}', {}, '/url_tag/'),
+            'url04' : ('{% url regressiontests.templates.views.client_location country="england",city="liverpool" %}', {}, '/url_tag/client/location/england/liverpool/'),
 
             # Failures
-            'url04' : ('{% url %}', {}, template.TemplateSyntaxError),
-            'url05' : ('{% url no_such_view %}', {}, ''),
-            'url06' : ('{% url regressiontests.templates.views.client no_such_param="value" %}', {}, ''),
+            'url05' : ('{% url %}', {}, template.TemplateSyntaxError),
+            'url06' : ('{% url no_such_view %}', {}, ''),
+            'url07' : ('{% url regressiontests.templates.views.client no_such_param="value" %}', {}, ''),
+            'url08' : ('{% url regressiontests.templates.views.client_location country="england", city="liverpool" %}', {}, template.TemplateSyntaxError),
         }
 
         # Register our custom template loader.
Index: tests/regressiontests/templates/urls.py
===================================================================
--- tests/regressiontests/templates/urls.py	(revision 4556)
+++ tests/regressiontests/templates/urls.py	(working copy)
@@ -7,4 +7,5 @@
     (r'^$', views.index),
     (r'^client/(\d+)/$', views.client),
     (r'^client/(\d+)/(?P<action>[^/]+)/$', views.client_action),
+    (r'^client/location/(?P<country>[^/]+)/(?P<city>[^/]+)/$', views.client_location),
 )
