[Pypi-checkins] r847 - trunk/appengine

martin.von.loewis python-checkins at python.org
Sat Aug 7 23:11:55 CEST 2010


Author: martin.von.loewis
Date: Sat Aug  7 23:11:55 2010
New Revision: 847

Modified:
   trunk/appengine/handlers.py
Log:
Give 404 on invalid package names.


Modified: trunk/appengine/handlers.py
==============================================================================
--- trunk/appengine/handlers.py	(original)
+++ trunk/appengine/handlers.py	Sat Aug  7 23:11:55 2010
@@ -17,6 +17,10 @@
             p = model.MirrorState.all().fetch(1)[0]
         else:
             p = model.Project.get_by_key_name(path)
+            if p is None:
+                self.response.set_status(404)
+                self.response.out.write("<html><head><title>404 Not Found</title></head><body>Package %s does not exist</body></html>" % path)
+                return
         self.response.out.write(p.simple)
 
 class LastModified(webapp.RequestHandler):


More information about the Pypi-checkins mailing list