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

martin.v.loewis python-checkins at python.org
Sat Aug 2 08:43:37 CEST 2008


Author: martin.v.loewis
Date: Sat Aug  2 08:43:37 2008
New Revision: 65398

Log:
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	Sat Aug  2 08:43:37 2008
@@ -706,6 +706,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