[Python-checkins] r70403 - tracker/roundup-src/roundup/cgi/client.py

martin.v.loewis python-checkins at python.org
Sun Mar 15 23:07:50 CET 2009


Author: martin.v.loewis
Date: Sun Mar 15 23:07:49 2009
New Revision: 70403

Log:
Reapply r65398:
Don't pass huge itemids into the backend.


Modified:
   tracker/roundup-src/roundup/cgi/client.py

Modified: tracker/roundup-src/roundup/cgi/client.py
==============================================================================
--- tracker/roundup-src/roundup/cgi/client.py	(original)
+++ tracker/roundup-src/roundup/cgi/client.py	Sun Mar 15 23:07:49 2009
@@ -843,6 +843,10 @@
                 klass = self.db.getclass(self.classname)
             except KeyError:
                 raise NotFound, '%s/%s'%(self.classname, self.nodeid)
+            if long(self.nodeid) > 2**31:
+                # Postgres will complain with a ProgrammingError
+                # if we try to pass in numbers that are too large
+                raise NotFound, '%s/%s'%(self.classname, self.nodeid)
             if not klass.hasnode(self.nodeid):
                 raise NotFound, '%s/%s'%(self.classname, self.nodeid)
             # with a designator, we default to item view


More information about the Python-checkins mailing list