From da6ec8eea78e2070bd1c83e983c8694596ec5cf8 Mon Sep 17 00:00:00 2001 From: helmutm Date: Thu, 14 Oct 2010 08:52:22 +0000 Subject: [PATCH] avoid conversion to unicode when working with path names git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@4041 fd906abe-77d9-0310-91a1-e0d9ade77398 --- storage/filesystem.py | 3 ++- util/format.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/storage/filesystem.py b/storage/filesystem.py index 87a2c9e..f23f777 100644 --- a/storage/filesystem.py +++ b/storage/filesystem.py @@ -49,11 +49,12 @@ class FileSystemStorage(object): def getDir(self, address, subDir=None): subDir = subDir or self.subDir + subDir = str(subDir) if self.rootDir is None: if subDir: return os.path.join(subDir, address) return address - return os.path.join(self.rootDir, subDir, address) + return os.path.join(str(self.rootDir), subDir, address) def setData(self, address, data, params={}): subDir = params.get('subdirectory') diff --git a/util/format.py b/util/format.py index da20356..388117a 100644 --- a/util/format.py +++ b/util/format.py @@ -64,6 +64,7 @@ def toStr(value, encoding='UTF-8'): return str(value) def toUnicode(value, encoding='UTF-8', fallback='ISO8859-15'): + # or: fallback='CP852' if isinstance(value, unicode): return value elif isinstance(value, str):