thirdparty/google_appengine/google/appengine/dist/py_zipimport.py
changeset 2864 2e0b0af889be
parent 2273 e4cb9c53db3e
--- a/thirdparty/google_appengine/google/appengine/dist/py_zipimport.py	Sat Sep 05 14:04:24 2009 +0200
+++ b/thirdparty/google_appengine/google/appengine/dist/py_zipimport.py	Sun Sep 06 23:31:53 2009 +0200
@@ -220,11 +220,14 @@
 
   def get_data(self, fullpath):
     """Return (binary) content of a data file in the zipfile."""
-    required_prefix = os.path.join(self.archive, '')
-    if not fullpath.startswith(required_prefix):
-      raise IOError('Path %r doesn\'t start with zipfile name %r' %
-                    (fullpath, required_prefix))
-    relpath = fullpath[len(required_prefix):]
+    prefix = os.path.join(self.archive, '')
+    if fullpath.startswith(prefix):
+      relpath = fullpath[len(prefix):]
+    elif os.path.isabs(fullpath):
+      raise IOError('Absolute path %r doesn\'t start with zipfile name %r' %
+                    (fullpath, prefix))
+    else:
+      relpath = fullpath
     try:
       return self.zipfile.read(relpath)
     except KeyError: