[Pypi-checkins] r927 - in trunk: appengine pypi
martin.von.loewis
python-checkins at python.org
Sun Jul 10 20:33:26 CEST 2011
Author: martin.von.loewis
Date: Sun Jul 10 20:33:26 2011
New Revision: 927
Modified:
trunk/appengine/handlers.py
trunk/pypi/gae.py
Log:
Skip over deleted files.
Modified: trunk/appengine/handlers.py
==============================================================================
--- trunk/appengine/handlers.py (original)
+++ trunk/appengine/handlers.py Sun Jul 10 20:33:26 2011
@@ -47,6 +47,8 @@
f.put()
f.contents = self.get_uploads()[0]
f.put()
+ if self.request.get('deleted'):
+ fetch.delete_file(f)
if m.current_upload != path:
logging.error('Unexpected upload of '+path)
else:
Modified: trunk/pypi/gae.py
==============================================================================
--- trunk/pypi/gae.py (original)
+++ trunk/pypi/gae.py Sun Jul 10 20:33:26 2011
@@ -31,7 +31,14 @@
try:
data = open(srcdir+"/"+path).read()
except IOError, e:
- return
+ if errno == errno.ENOENT:
+ # file has been deleted
+ session += '&deleted=1'
+ data = ''
+ else:
+ # some other problem with file. GAE will request transfer
+ # again
+ return
boundary = ""
while boundary in data:
boundary = binascii.hexlify(os.urandom(10))
More information about the Pypi-checkins
mailing list