[Pypi-checkins] r747 - branches/tarek-pep-345-support

tarek.ziade python-checkins at python.org
Wed Mar 17 05:14:09 CET 2010


Author: tarek.ziade
Date: Wed Mar 17 05:14:09 2010
New Revision: 747

Modified:
   branches/tarek-pep-345-support/pypi.wsgi
Log:
handle request with empty data

Modified: branches/tarek-pep-345-support/pypi.wsgi
==============================================================================
--- branches/tarek-pep-345-support/pypi.wsgi	(original)
+++ branches/tarek-pep-345-support/pypi.wsgi	Wed Mar 17 05:14:09 2010
@@ -6,13 +6,16 @@
 
 store.keep_conn = True
 
-CONFIG_FILE = '/data/pypi/config.ini'
+CONFIG_FILE = 'config.ini'
 
 class Request:
 
     def __init__(self, environ, start_response):
         self.start_response = start_response
-        length = int(environ['CONTENT_LENGTH'])
+        try:
+            length = int(environ['CONTENT_LENGTH'])
+        except ValueError:
+            length = 0
         self.rfile = cStringIO.StringIO(environ['wsgi.input'].read(length))
         self.wfile = cStringIO.StringIO()
         self.config = config.Config(CONFIG_FILE )


More information about the Pypi-checkins mailing list