[Pypi-checkins] r945 - trunk/pypi

richard python-checkins at python.org
Mon Aug 22 03:29:37 CEST 2011


Author: richard
Date: Mon Aug 22 03:29:37 2011
New Revision: 945

Modified:
   trunk/pypi/webui.py
Log:
handle bare values uploaded as file content; thanks Capel Brunker

Modified: trunk/pypi/webui.py
==============================================================================
--- trunk/pypi/webui.py	(original)
+++ trunk/pypi/webui.py	Mon Aug 22 03:29:37 2011
@@ -2234,7 +2234,13 @@
         if not self.form.has_key('content'):
             raise FormError, "No file uploaded"
 
-        data = self.form['content'].value
+        try:
+            data = self.form['content'].value
+        except AttributeError:
+            # error trying to get the .value *probably* means we didn't get
+            # a file uploaded in the content element
+            raise FormError, "No file uploaded"
+
         if len(data) > 10*1024*1024:
             raise FormError, "Documentation zip file is too large"
         data = cStringIO.StringIO(data)


More information about the Pypi-checkins mailing list