Commits

Anonymous committed e19ebdd

Windows fixes

  • Participants
  • Parent commits 2c055ef

Comments (0)

Files changed (1)

gp/fileupload/upload.py

 
     if not tempdir:
         tempdir = TEMP_DIR
+    else:
+        tempdir = os.path.normpath(tempdir)
 
     if max_size:
         # use Mo
         require_session = False
 
     if upload_to:
+        upload_to = os.path.normpath(upload_to)
         if exclude_paths is None:
             exclude_paths = []
         else:
             if isinstance(exclude_paths, basestring):
-                exclude_paths = [f for f in exclude_paths.split(' ') if f]
+                exclude_paths = [os.path.normpath(f) for f
+                                 in exclude_paths.split(' ') if f]
         application = Storage(
             application, upload_to, tempdir, exclude_paths,
             max_size=max_size, require_session=require_session)
 
     if include_files:
         if isinstance(include_files, basestring):
-            include_files = [f for f in include_files.split(' ') if f]
+            include_files = [os.path.normpath(f) for f
+                             in include_files.split(' ') if f]
         application = ResourceInjection(application, include_files)
 
     return FileUpload(