Permalink
Browse files

windows fix with file-object path, fixed #132

  • Loading branch information...
1 parent 9bd8c64 commit 442682d317b5c91de46d9ddf9d4d636c0fbf70ec @sehmaschine committed Feb 14, 2013
Showing with 5 additions and 2 deletions.
  1. +5 −2 filebrowser/base.py
View
7 filebrowser/base.py
@@ -1,7 +1,7 @@
# coding: utf-8
# PYTHON IMPORTS
-import os, shutil, re, datetime, time
+import os, shutil, re, datetime, time, platform
import mimetypes
# DJANGO IMPORTS
@@ -191,7 +191,10 @@ def __init__(self, path, site=None):
from filebrowser.sites import site as default_site
site = default_site
self.site = site
- self.path = path
+ if platform.system() == 'Windows':
+ self.path = path.replace('\\','/')
+ else:
+ self.path = path
self.head = os.path.dirname(path)
self.filename = os.path.basename(path)
self.filename_lower = self.filename.lower()

0 comments on commit 442682d

Please sign in to comment.