diff options
author | Sascha Silbe <sascha-pgp@silbe.org> | 2011-10-11 17:31:54 (GMT) |
---|---|---|
committer | Sascha Silbe <sascha-pgp@silbe.org> | 2011-10-11 17:31:54 (GMT) |
commit | e880cd49e23e61f55d89dfa2e5ef4814b459ee21 (patch) | |
tree | fc5a8385b9964ecd79f16deafbb15f5100dc33c4 | |
parent | 43aee2b178a4130c0931fb113db6940e55564d73 (diff) |
Don't pass unicode strings to FUSE
FUSE doesn't like getting passed unicode strings; it does strange things like
ignoring readdir() results that are unicode strings.
We encode them as UTF-8. Arguably we should use the current locale charset
instead, but that would mean we have to deal with unencodable characters.
People just just move on and enter the Unicode world instead of relying on
legacy encodings. And at least Sugar is as broken as we are in this
respect. ;)
-rwxr-xr-x | datastore-fuse.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/datastore-fuse.py b/datastore-fuse.py index da296b3..ad33819 100755 --- a/datastore-fuse.py +++ b/datastore-fuse.py @@ -283,6 +283,7 @@ class ByTagsDirectory(Directory): yield entry for tag in self._get_tags(): + tag = unicode(tag).encode('utf-8') if '/' in tag: continue @@ -713,7 +714,7 @@ class DataStoreFS(fuse.Fuse): time_human = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(mtime)) name = '%s - %s' % (title, time_human) - name = safe_name(name) + name = unicode(safe_name(name)).encode('utf-8') extension = self._guess_extension(metadata.get('mime_type'), object_id) if extension: current_name = '%s.%s' % (name, extension) |