[bfss] convert root BFSS directory to str in constructor (closes #2137793)
otherwise you can get crashed with AssertionError: Binary objects must use raw strings, not <type 'unicode'>
--- a/server/sources/storages.py Tue Jan 03 12:21:44 2012 +0100
+++ b/server/sources/storages.py Tue Jan 03 17:00:43 2012 +0100
@@ -113,6 +113,8 @@
class BytesFileSystemStorage(Storage):
"""store Bytes attribute value on the file system"""
def __init__(self, defaultdir, fsencoding='utf-8'):
+ if type(defaultdir) is unicode:
+ defaultdir = defaultdir.encode(fsencoding)
self.default_directory = defaultdir
self.fsencoding = fsencoding
@@ -201,7 +203,8 @@
name = entity.cw_attr_metadata(attr, 'name')
if name is not None:
basename.append(name.encode(self.fsencoding))
- fspath = uniquify_path(self.default_directory, '_'.join(basename))
+ fspath = uniquify_path(self.default_directory,
+ '_'.join(basename))
if fspath is None:
msg = entity._cw._('failed to uniquify path (%s, %s)') % (
self.default_directory, '_'.join(basename))