req.py
branchstable
changeset 6321 a8a33679f4dd
parent 6309 9f03e3c32676
child 6582 8eb7883b4223
child 6747 63bf61e4e130
--- a/req.py	Thu Sep 23 13:10:29 2010 +0200
+++ b/req.py	Thu Sep 23 12:16:36 2010 +0200
@@ -174,6 +174,8 @@
         """return an absolute URL using params dictionary key/values as URL
         parameters. Values are automatically URL quoted, and the
         publishing method to use may be specified or will be guessed.
+
+        raises :exc:`ValueError` if None is found in arguments
         """
         # use *args since we don't want first argument to be "anonymous" to
         # avoid potential clash with kwargs
@@ -201,7 +203,6 @@
             return u'%s%s' % (base_url, path)
         return u'%s%s?%s' % (base_url, path, self.build_url_params(**kwargs))
 
-
     def build_url_params(self, **kwargs):
         """return encoded params to incorporate them in an URL"""
         args = []
@@ -209,6 +210,8 @@
             if not isinstance(values, (list, tuple)):
                 values = (values,)
             for value in values:
+                if value is None:
+                    raise ValueError(_('unauthorized value'))
                 args.append(u'%s=%s' % (param, self.url_quote(value)))
         return '&'.join(args)